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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -