title: Rails: How to pass array from view to controller with button_to
body: <p>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.</p>
  
  <pre><code>  &lt;% @items.each do |item| %&gt;
      &lt;li&gt;
        &lt;%= link_to item.name, item %&gt;
        &lt;%= select_tag 'count[]', options_for_select([0,1,2,3,4,5])%&gt;
      &lt;/li&gt;
    &lt;% end %&gt;
    &lt;%= button_to 'Place Order', orders_confirm_path, method: :post, params: { ??? } %&gt;
  </code></pre>