I'm new to rails. What I'm trying to do is to design an order system. It lists a bunch of items and each item is followed by a select box so that people can choose the number that they want to order. My question is how to pass this count[] array and the corresponding item id from view to controller using button_to. Thank you for any suggestions.
<% @items.each do |item| %>
<li>
<%= link_to item.name, item %>
<%= select_tag 'count[]', options_for_select([0,1,2,3,4,5])%>
</li>
<% end %>
<%= button_to 'Place Order', orders_confirm_path, method: :post, params: { ??? } %>