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

**URL:** <https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799>\
**Category:** Rails\
**Created:** [December 16, 2005, 4:42am UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799 "2005-12-16T04:42:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [December 16, 2005, 4:42am UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799/1 "2005-12-16T04:42:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [December 16, 2005, 5:24am UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799/2 "2005-12-16T05:24:15Z")

</div>

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](http://wiki.rubyonrails.com/rails/pages/Plugins)

Duane J.  
(canadaduane)

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [December 16, 2005, 6:42am UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799/3 "2005-12-16T06:42:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [December 16, 2005, 5:06pm UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799/4 "2005-12-16T17:06:25Z")

</div>

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](http://pengoworks.com/index.cfm?action=get:qforms)

Duane J.  
(canadaduane)

---

<div class="post-metadata">

**Author:** ![soderic](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@soderic](https://www.ruby-forum.com/u/soderic)\
**Post date:** [December 16, 2005, 6:54am UTC](https://www.ruby-forum.com/t/newbie-q-controllers-and-lookup-tables-when-to-initialise/53799/5 "2005-12-16T06:54:27Z")

</div>

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.
