Dropdown-Select for a database table
drop-down-menu, ruby-on-rails, select
Solution
Use select, for example:
select(:model, :attribute, Student.all.collect {|p| [ p.name, p.id ] })
Problem
I simply want to have a dropdown menu which will have all the rows of a table as its choices. How do I achieve that? Let's say I have a model "Student" and I want to have the "name" property to be displayed in the choices. Thanks in advance.