Hello, Can anyone please point me in the right direction - I would like the user to be able to select options from drop down menus and for the app to get the information from the database. Where do I find out about GUI stuff?? Chris -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Michael Modica
2006-Aug-23 16:07 UTC
[Rails] Re: GUI - lists, drop-down menus and all that ..
Chris Finch wrote:> Hello, > > Can anyone please point me in the right direction - > > I would like the user to be able to select options from drop down menus > and for the app to get the information from the database. > > Where do I find out about GUI stuff?? > > ChrisChris, I suggest acts_as_enumerated for a plugin. Create a list of values table (or whatever) with key | value pairs and use it to generate your list. The view code would then look something like this (taken from my app): <td width="20%" valign="top" class="dataField"> <%= select (:order, :order_status, OrderStatus.all.collect {|s| [ (s.value), s.value ]}, { :include_blank => true } %> </td> In this example, OrderStatus is the type I setup per the instructions via acts_as_enumerated. This caches the values so you aren''t doing a lookup every time. If you need the lookup done every time then this isn''t a good solution for you. I use it for status values, state picklists, etc... Basically, anything that doesn''t change frequently. Regards, Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---