checkbox array

Can't get array. The controller gets only 1 parametr.

Form in view:

<div class="field">
    <% Categor.all.each do |cat| %>
       <%= check_box_tag(:prodcat,cat.id) %>
       <%= label_tag(:prodcat, cat.title) %><br>
    <% end %>
</div>

Controller:

params[:prodcat].each do |cat|
   @pc=Prodcat.new(@product.id,cat)
   @pc.save
end

How i can get array?

Can't get array. The controller gets only 1 parametr.

Form in view:

<div class="field">
   <% Categor.all.each do |cat| %>
      <%= check_box_tag(:prodcat,cat.id) %>
      <%= label_tag(:prodcat, cat.title) %><br>
   <% end %>
</div>

Controller:

params[:prodcat].each do |cat|
  @pc=Prodcat.new(@product.id,cat)
  @pc.save
end

How i can get array?

In view...

<%= check_box_tag('prodcat[]', cat.id) %>

Would be one way...

-philip