I am fairly new to RoR and I have encountered something that I was unable to figure out by searching google or the API resource Basically I would like to populate a select drop down box on a form with values that have been created on another model. I am trying to make a form to "create a new order" and on that form select a vendor that has already been populate from the vendor model Can someone please help me come up with the code to make this drop down box dynamically populated from the vendor table? I want the drop down box to contain the vendor.name and also have the id each of the vendors. Any help in the right direction would be greatly appreciated. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Oct 14, 6:50 pm, David <da...-uegTc69f7dvgU0tbg7O/M0EOCMrvLtNR@public.gmane.org> wrote:> > Can someone please help me come up with the code to make this drop > down box dynamically populated from the vendor table? I want the drop > down box to contain the vendor.name and also have the id each of the > vendors. > > Any help in the right direction would be greatly appreciated.See http://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html or http://guides.rubyonrails.org/form_helpers.html#making-select-boxes-with-ease Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.