我正在严格寻找铁路的答案,并希望能够很好地解释它是如何工作的,因为我已经尝试了几个小时但无法弄明白。
我要做的是拥有一个select_tag
但能够将参数:number_of_cards传递给多个动作(无论动作是在同一个控制器中还是在不同的控制器中都无关紧要。)
示例代码
<%= form_tag arbitrary_1st_path, :method => :get do |f| %>
<%= select_tag(:number_of_cards, options_for_select(1..20, 2)) %>
<%= submit_tag("1st_path")%>
<% end %>
<%= form_tag arbitrary_2nd_path, :method => :get do |f| %>
<%= select_tag(:number_of_cards, options_for_select(1..20, 2)) %>
<%= submit_tag("2nd_path")%>
<% end %>
<%= form_tag arbitrary_3rd_path, :method => :get do |f| %>
<%= select_tag(:number_of_cards, options_for_select(1..20, 2)) %>
<%= submit_tag("3rd_path")%>
<% end %>
提前感谢!