ruby on rails - form tag just one value pass instead of multiple -


i have form_tag in form contains 2 drop down boxes. when submit form both fields id isn't pass dont know did wrong...

<%= form_tag '/daily_report' -%> <label>search</label> <%= select_tag "id", options_from_collection_for_select(user.all, "id", "firstname",:selected => @s) %> <%= select_tag "id", options_from_collection_for_select(project.all, "id", "name",:selected => @s) %> <%= submit_tag "search", :name => nil %> <% end -%> 

if use same name values overwritten , 1 result. change name , make different.

<%= select_tag "users", options_from_collection_for_select(user.all, "id", "firstname",:selected => @s) %> <%= select_tag "projects", options_from_collection_for_select(project.all, "id", "name",:selected => @s) %> 

you can access using names, :users , :projects


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -