我有一组复选框,我想将它们变成多选输入:
<div id="taxons_offered">
<h3>Taxonomies Offered In</h3>
<% for store in Store.all %>
<% if store.has_taxonomies? %>
<div store_id='<%= store.id %>'>
<h4><%= store.name %></h4>
<ul class="multi-column-checkbox">
<% for taxonomy in store.taxonomies %>
<li><%= check_box_tag "idea[taxonomy_ids][]",
taxonomy.id, @idea.taxonomies.include?(taxonomy) %> <%= taxonomy.name %></li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
我尝试用 collection_select 替换 check_box_tag 但它坏了