Sha256: 84f29d83448bb5df76b58ab842fae55d4b3d81bae02139751e46c7d74048fbc8

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

- table_name = @ar_object._reflections[assoc_name.to_s].klass.table_name.to_sym
.nested-field-wrapper data-table-name=assoc_name data-model-name=assoc_name.to_s.classify
  label.field-label = assoc_name.to_s.titleize
  - fields = section.nested_table_fields[assoc_name]
  table.nested-form-table
    thead
      tr
        th
          | 
        - fields.each do |field|
          th
            = field.field_name.to_s.titleize 
    tbody.insert-cocoon-position
      = f.fields_for table_name do |record|
        - if record.object.persisted? || @ar_object.errors.present?
          = render partial: '/cm_admin/main/nested_fields', locals: { f: record, assoc_name: assoc_name, section: section, fields: fields }
  - if @reflections.select {|x| x if x.name == assoc_name}.first.macro == :has_many
    .links
      = link_to_add_association "+ Add #{assoc_name.to_s.titleize}", f, table_name, partial: '/cm_admin/main/nested_fields', render_options:  {locals: { assoc_name: assoc_name, section: section, fields: fields }}, data: { association_insertion_node: '.insert-cocoon-position', association_insertion_method: 'append' }, class: 'btn-primary'

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cm-admin-1.2.7 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.6 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.5 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.4 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.3 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.2 app/views/cm_admin/main/_nested_table_form.html.slim
cm-admin-1.2.1 app/views/cm_admin/main/_nested_table_form.html.slim