<%= form_for form_resource, url: form_url, html: { class: 'form-horizontal' }, remote: true do |f| %>
<%= f.select :name, resource.model_klass_name.constantize.column_names.map { |cn| [cn, cn] }, {}, { class: 'form-control' } %>
<%= f.text_field :label, class: 'form-control' %>
<%= f.select :entity_field_type_id, SimpleAdmin::EntityFieldType.all.collect { |ft| [ft.name, ft.id] }, {}, { class: 'form-control' } %>
<%= f.select :presentation, SimpleAdmin::EntityField.presentations.keys, {}, { class: 'form-control' } %>
<%= f.hidden_field :entity_id, value: resource.to_param %> <% if form_resource.entity_field_setting.present? %> <%= f.fields_for :entity_field_setting do |ef| %>
<%= ef.text_field :value, class: 'form-control' %>
<% end %> <% end %>
<%= f.check_box :search_indexable %>
<% if form_resource.persisted? %>
<%= f.submit class: 'btn btn-sm btn-primary' %> <%= link_to 'Delete', admin_system_entity_field_path(form_resource), class: 'btn btn-sm btn-danger', method: :delete, remote: true, data: { confirm: t('simple_admin.actions.confirm') } %>
<% else %>
<%= f.submit class: 'btn btn-sm btn-primary' %>
<% end %> <% end %>