Forum: Ruby on Rails Newbie Q: Controllers and lookup tables - when to initialise

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Eric S. (Guest)
on 2005-12-16 05:42
(Received via mailing list)
Howdy Gang,
in a major controller that has many methods using the same lookup tables
for option choices and such, what is the life expectancy of the list
instances. Is it useful to set these up in the controller initialize
method - or is that utterly dumb?
Cheers,
Eric
Duane J. (Guest)
on 2005-12-16 06:24
(Received via mailing list)
On Dec 15, 2005, at 8:37 PM, Eric S. wrote:

> Howdy Gang,
> in a major controller that has many methods using the same lookup
> tables for option choices and such, what is the life expectancy of
> the list instances. Is it useful to set these up in the controller
> initialize method - or is that utterly dumb?
> Cheers,
> Eric
>

Take a look at ActiveRecord Enumerations on the plugins page:

http://wiki.rubyonrails.com/rails/pages/Plugins

Duane J.
(canadaduane)
Eric S. (Guest)
on 2005-12-16 07:42
(Received via mailing list)
Looks like what I'm after Duane - Thanks - Eric
Eric S. (Guest)
on 2005-12-16 07:54
(Received via mailing list)
Hi again - Actually would that also answer my other question ;

HOW DO I populate options from previous option click?
> Hi,
> I have a form with three drop down option lists. Currently each of these  contain full 
listings as instantiated in the controller on entering the edit action. What I would like 
to do is filter the second list based on what the user selected on the first and the third 
filtered to reflect the second.
> For example I have major_role, role and person_in_role = role is a subset of major_role 
and person_in_role is one qualified to act in role
> Kind Regards,
> Eric

Thanks Mate,
Eric.
Duane J. (Guest)
on 2005-12-16 18:06
(Received via mailing list)
On Dec 15, 2005, at 10:42 PM, Eric S. wrote:

>> subset of major_role and person_in_role is one qualified to act in
>> role
>> Kind Regards,
>> Eric
>
> Thanks Mate,
> Eric.
>
I would use something like qForms for this.  It seems to do a nice
job, and can interoperate with Rails conventions quite well.

http://pengoworks.com/index.cfm?action=get:qforms

Duane J.
(canadaduane)
This topic is locked and can not be replied to.