<%# - - - - - - - - - - - - %> <%# TEXT / STRING %> <%# - - - - - - - - - - - - %> <% if field_setting.field_type == 'text' || field_setting.field_type == 'string' %> <% current = @component.find_or_create_a_field_by( field_setting.id, 'text' ) %> <%= f.simple_fields_for "texts_attributes[]", current do |ff| %> <%= render 'form_item_text', ff: ff, field_setting: field_setting %> <% end %> <%# - - - - - - - - - - - - %> <%# DATE %> <%# - - - - - - - - - - - - %> <% elsif field_setting.field_type == 'date' %> <% current = @component.find_or_create_a_field_by( field_setting.id, 'date' ) %> <%= f.simple_fields_for "dates_attributes[]", current do |ff| %> <%= render 'form_item_date', ff: ff, field_setting: field_setting %> <% end %> <%# - - - - - - - - - - - - %> <%# ASSET %> <%# - - - - - - - - - - - - %> <% elsif field_setting.field_type == 'asset' %> <% current = @component.find_or_create_a_field_by( field_setting.id, 'asset' ) %> <%= f.simple_fields_for "assets_attributes[]", current do |ff| %> <%= render 'form_item_asset', ff: ff, field_setting: field_setting %> <% end %> <%# - - - - - - - - - - - - %> <%# REPEATER %> <%# - - - - - - - - - - - - %> <% elsif field_setting.field_type == 'repeater' %> <% repeaters = @component.repeaters.where( field_setting: field_setting ).order('position') %> <%= render 'form_item_repeater', f: f, repeater_setting: field_setting, repeaters: repeaters %> <% elsif ['radio', 'select', 'checkbox'].include? field_setting.field_type %> <%= render 'form_item_selectable', f: f, field_setting: field_setting %> <% end %>