<%# - - - - - - - - - - - - %> <%# CHOICES %> <%# - - - - - - - - - - - - %>
<%= t(:choices).capitalize %>
<%= ff.simple_fields_for :choices, ff.object.choices.order( :label ) do |fff| %>
<%= fff.input :id, as: :hidden %> <%= fff.association :field_setting, as: :hidden %>
<%= t(:choice_label).capitalize %> <%= fff.input :label %>
<%= t(:choice_value).capitalize %> <%= fff.input :value %>
<% end %> <%# - - - - - - - - - - - - %> <%# DEFAULT INITIAL CHOICE %> <%# - - - - - - - - - - - - %> <% unless ff.object.choices.find_all{|c| c.persisted? }.any? %> <%= f.simple_fields_for "new_choices[]", ff.object.choices.build() do |fff| %>
<%= fff.association :field_setting, as: :hidden %>
<%= t(:choice_label).capitalize %> <%= fff.input :label %>
<%= t(:choice_value).capitalize %> <%= fff.input :value %>
<% end %> <% end %> <%# - - - - - - - - - - - - %> <%# NEW CHOICE %> <%# - - - - - - - - - - - - %> <%= f.simple_fields_for "new_choices[]", ff.object.choices.build() do |fff| %>
<%= fff.association :field_setting, as: :hidden %>
<%= t(:choice_label).capitalize %> <%= fff.input :label %>
<%= t(:choice_value).capitalize %> <%= fff.input :value %>
<% end %> <%= t(:add_choice).capitalize %>  
<%# - - - - - - - - - - - - %> <%# DEFAULT CHOICE %> <%# - - - - - - - - - - - - %> <% if ff.object.choices.find_all{|c| c.persisted? }.any? %>
<%= t(:default_choice).capitalize %>
<%= ff.input :default_choice_id, as: :select, collection: ff.object.choices.find_all{|c| c.persisted? }, label_method: :label, include_blank: false, selected: ff.object.default_choice_id, hint: t(:default_choice_description).capitalize %>
<% end %> <% if ff.object.field_type == 'checkbox' %> <%# - - - - - - - - - - - - %> <%# ALLOW NULL %> <%# - - - - - - - - - - - - %>
<%= t(:allow_null).capitalize %>
<%= ff.input :allow_null, as: :boolean, boolean_style: :inline, input_html: { class: "form-item--input" }, checked_value: true, unchecked_value: false, selected: ff.object.allow_null, default: false %>
<% end %>