Newbie Q: Controllers and lookup tables - when to initialise

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie Q: Controllers and lookup tables - when to initialise

Eric Sloane
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

_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: Newbie Q: Controllers and lookup tables - when to initialise

Duane Johnson

On Dec 15, 2005, at 8:37 PM, Eric Sloane 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:


Duane Johnson
(canadaduane)

_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: Newbie Q: Controllers and lookup tables - when to initialise

Eric Sloane
Looks like what I'm after Duane - Thanks - Eric
Duane Johnson wrote:

>
> On Dec 15, 2005, at 8:37 PM, Eric Sloane 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 Johnson
> (canadaduane)
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails

_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: Newbie Q: Controllers and lookup tables - when to initialise

Eric Sloane
In reply to this post by Duane Johnson
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 Johnson wrote:

>
> On Dec 15, 2005, at 8:37 PM, Eric Sloane 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 Johnson
> (canadaduane)
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> [hidden email]
> http://lists.rubyonrails.org/mailman/listinfo/rails

_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails
Reply | Threaded
Open this post in threaded view
|

Re: Re: Newbie Q: Controllers and lookup tables - when to initialise

Duane Johnson

On Dec 15, 2005, at 10:42 PM, Eric Sloane wrote:

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.

I would use something like qForms for this.  It seems to do a nice job, and can interoperate with Rails conventions quite well.


Duane Johnson
(canadaduane)

_______________________________________________
Rails mailing list
[hidden email]
http://lists.rubyonrails.org/mailman/listinfo/rails