I am looking to get my option drop down list to populate from a model.
In my controller i’m using:
@roles = Role.find(:all, :order => “name”)
in my view I have:
<%= collection_select(:id, :name, @roles, :id, :name) %> role <%=
submit_tag(“Go”) %>
I cannot get just the id of the selected option. If i inspect the params
I get:
{“commit”=>“Go”, “action”=>“view_role_rights”, “id”=>{“name”=>“1”},
“controller”=>“accounts”}
What is going on there? can anyone help?