title: Rails form_for only submitting last input
body: <p>Im trying to create inputs by looping each product and have one form submission for all the inputs. Currently, the form only submits the last input. How would I make it so all the inputs get submitted?  </p>
  
  <pre><code>&lt;%= form_for :inventory do |f| %&gt;
      &lt;% @products.each do |product| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= product.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= product.measurement %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= f.number_field :amount, class: 'form-control' %&gt;&lt;/td&gt;
          &lt;%= f.hidden_field :product_id, :value =&gt; product.id %&gt;
        &lt;/tr&gt;
        &lt;% end %&gt;
       &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>