Sha256: 83aa57d99c1b5935bcfce08af06c5975aebf7661b013dbc130cb7d5a7a819ded
Contents?: true
Size: 838 Bytes
Versions: 18
Compression:
Stored size: 838 Bytes
Contents
<%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %> <%= render 'slash_admin/shared/tooltip', a: a %> <%= f.collection_select "#{a.to_s.singularize}_ids", class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id IN(#{f.object.send(a).pluck(:id).join(',')}) THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id, object_label(class_name_from_association(f.object, a)), {include_blank: true}, { class: 'form-control select2-model-multiple', multiple: true, 'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore, 'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '), required: required?(f.object, a) } %>
Version data entries
18 entries across 18 versions & 1 rubygems