%
block = properties['options']
args = properties.except('options')
collection = block.call(@resource_instance)
if collection.class.to_s.demodulize == 'ActiveRecord_Relation'
id_method = :id
label_method = :name
else
# collection is an array of arrays:
# [
# [123, value],
# [456, value]
# ...
# ]
id_method = :first
label_method = :last
end
%>
<%= properties['label'] %>
<%= hidden_field_tag("#{class_name_downcase(f.object)}[#{relationship_ids(properties["model"])}][]", nil) %>
<%= f.collection_check_boxes(
attribute,
collection,
id_method,
label_method
) %>
<% if !is_modal &&
(
properties['remote_resource'].nil? ||
properties['remote_resource']
) %>
<%= render(
'adminpanel/shared/create_remote_resource_button',
remote_model: attribute.gsub('_ids', '')
) %>
<% end %>