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.
ROR (Guest)
on 2007-01-30 06: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
Mick S. (Guest)
on 2007-01-30 08: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.