Newbie Q: Controllers and lookup tables - when to initialise


#1

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


#2

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)


#3

Looks like what I’m after Duane - Thanks - Eric


#4

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)


#5

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.