Rails: use select_tag to update column in rich join table
===

I have a model LineItem that is associated to the Delivery model with a has_many_though association. The join model is Shipment.

    class LineItem < ActiveRecord::Base
      has_many :shipments
      has_many :deliveries, :through => :shipments
    end

    class Delivery < ActiveRecord::Base
      has_many :shipments
      has_many :line_items, :through => :shipments
    end

    class Shipment < ActiveRecord::Base
      belongs_to :line_item
      belongs_to :delivery
    end

The shipments table has, next to the line_item_id and delivery_id columns, also a quantity column. I would like to fill the fields in this column through the new/edit views of the deliveries with the help of a dropdown menu. This is (a somewhat simplified version of) my form:

    <%= form_for(@delivery) do |f| %>
      <div class="field">
        <%= f.label :delivery_number %><br />
        <%= f.text_field :delivery_number %>
      </div>
      <div class="field">
        <% @line_items.group_by { |line_item| line_item.order }.each do |order, line_items| %>
          <h4><%= order.order_number %></h4>
          <%= hidden_field_tag "delivery[line_item_ids][]", nil %>
          <% line_items.each do |line_item| %>
            <%= check_box_tag "delivery[line_item_ids][]", line_item.id, @delivery.line_item_ids.include?(line_item.id) %>
            <%= select_tag "quantity[]", options_for_select((1..25).to_a) %>
            <%= line_item.name %>
          <% end %>
        <% end %>
      </div>
      <%= f.submit %>
    <% end %>

So, there are check_boxes to indicate which associations between the delivery and the line_items to create/update, and I have dropdown menus to indicate the quantity of each line_item that is delivered. The indicated 'quantity' for these line_items should populate the quantity fields in the shipments table for the appropriate line_item-delivery rows.  However, I'm unsure whether select_tag is the right way to go and if so, how to get the 'quantity' data in the correct way in the shipments table.
Any help is appreciated. Thanks.