We need to add a hidden field for each group of check boxes, so if we don't check anything, the hidden field is sent to the server, indicating nothing was selected. Without the hidden field, the server will not know anything has been done to the check boxes. The easiest way to do it is using `collection_check_boxes`, which also adds labels to every check box.
12 lines
565 B
Plaintext
12 lines
565 B
Plaintext
<div class="secondary callout is-hidden js-budget-users-list small-12" data-toggler="is-hidden" data-closable id="<%= assignable_type %>_list">
|
|
<% if assignables.nil? || assignables.empty? %>
|
|
<p><%= t("admin.budgets.edit.empty_#{assignable_type}") %></p>
|
|
<% else %>
|
|
<h3><%= t("admin.budgets.edit.#{assignable_type}", count: 0) %></h3>
|
|
<% field = "#{assignable_type.chomp("s")}_ids" %>
|
|
<%= form.collection_check_boxes field, assignables, :id, :name do |box| %>
|
|
<%= box.label { box.check_box + box.text } %>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|