Sha256: 0a2d53a4313a0edf472f68f553f7c9bc3eae13bbe4c8c3bdcc84a9481e634744
Contents?: true
Size: 876 Bytes
Versions: 6
Compression:
Stored size: 876 Bytes
Contents
<%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %> <%= f.select a.to_s, class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20).collect { |assoc| [assoc.send(object_label(class_name_from_association(f.object, a))), assoc.id] }, { prompt: t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase), }, '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(' '), class: 'selectize-model-single', required: required?(f.object, a).present? %>
Version data entries
6 entries across 6 versions & 1 rubygems