How to fetch data's from database in a drop down box


#1

hi,

i am very new to ruby. can u give the coding for to fetch data’s from
database in a drop down box


#2

Use the collection_select helper, e.g.:

<%= collection_select(:event, :venue_id, Venue.find(:all), :id, :name)
%>