Sha256: cd67f0744b1ef6f45ccc100163c9b55767f6a47368b6700b6901d56a978df42b

Contents?: true

Size: 1.47 KB

Versions: 2

Compression:

Stored size: 1.47 KB

Contents

<%# - - - - - - - - - - - - %>
<%# 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 ) %>
  <%= render 'form_item_repeater', f: f, repeater_setting: field_setting, repeaters: repeaters %>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
binda-0.0.3 app/views/binda/components/_form_section.html.erb
binda-0.0.2 app/views/binda/components/_form_section.html.erb