forms - Rails - select_tag / chechbox tag issue - can't get array of IDs -
i've got list of products in form that's resource want submit. works without using label tag, want label tag working.
<%= label_tag "product_ids[#{product.id}]" %> <%= check_box_tag "product_ids[#{product.id}]" %> <%= product.name %> <% end %>
this produces following output:
"product_ids"=>{"2"=>"1", "6"=>"1", "3"=>"1"}
is possible array of ids , not hash?
change
<%= check_box_tag "product_ids[]", nil, nil, id: "product_ids[#{product.id}]" %>
and params['product_ids[]']
try way?
Comments
Post a Comment