aris
June 21, 2012, 9:25pm
1
Hi,
I’m new to ruby on rails and I have little problem. I need to make
application that creates list of items on startup. So model shouldnt
have database.
Is the best choice to use standard class as model, for example
item.rb in models folder?
What’s the best way to create collection of model on controller
startup?
Is it creating array of model classes in initialize() method of
controller?
My app should have search functionality based on items name. Is the
best way to simply search array in for loop and return searched items?
Is there any better and simplier approach than this I described?
Thanks in advance
aldm
June 21, 2012, 9:56pm
2
On Thu, Jun 21, 2012 at 4:25 PM, Amer Z. [email protected]
wrote:
startup?
Hi,
maybe this could help you
Best,
Martin
aldm
June 22, 2012, 12:07am
3
On Thu, 21 Jun 2012 16:54:46 -0300
Martin A. [email protected] wrote:
I’m new to ruby on rails and I have little problem. I need to make
application that creates list of items on startup. So model shouldnt
have database.
maybe this could help you
#326 ActiveAttr - RailsCasts
#193 Tableless Model - RailsCasts
The table-less model railscast is kinda outdated and can lead into
something wrong I think :)) It’s better to watch this one:
Or read Yehuda’s introduction:
Rails 2.3 has a ton of really nice functionality locked up in monolithic
components. I've posted quite a bit about how we've opened up a lot of that
functionality in ActionPack, making it easier to reuse the router, dispatcher,
and individual parts...
–
Sincerely yours,
Aleksey V. Zapparov A.K.A. ixti
FSF Member #7118
Mobile Phone: +34 677 990 688
Homepage: http://www.ixti.net
JID: [email protected]
*Origin: Happy Hacking!
aldm
June 22, 2012, 12:19pm
4
Thanks for the answers.
Can you tell me hwt’s the best way to make collection of this model
classes
on app startup - is it initialize method of controller and what’s the
best way to search that collection - make serch action in controller ?