Forum: Ruby on Rails how to fetch data's from database in a drop down box

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
46911700017303070d64f73b69bb04a8?d=identicon&s=25 ROR (Guest)
on 2007-01-30 05:40
hi,

   i am very new to ruby. can u give the coding for to fetch data's from
database in a drop down box
F5c118aaeb5bb7162db613a37e595be8?d=identicon&s=25 Mick Sharpe (micksharpe)
on 2007-01-30 07:50
Use the collection_select helper, e.g.:

<%= collection_select(:event, :venue_id, Venue.find(:all), :id, :name)
%>
This topic is locked and can not be replied to.