Sha256: ff9856e91f0a51fd05acd610c9520b90d46fac95e36c88afe863466a2d9fe1e1

Contents?: true

Size: 621 Bytes

Versions: 3

Compression:

Stored size: 621 Bytes

Contents

.nested-fields

  - if subpart.repeatable?
    .right= link_to_remove_association "x", f, class: "btn btn-danger"

  - for field in subpart.fields.sort_by(&:position)

    = f.simple_fields_for :fields, field do |w|

      / TODO: Refactor!
      - if field.new_record?

        - for attribute in [:identifier, :label, :type, :required, :position, :hint, :placeholder]
          = w.input attribute, as: :hidden unless field.send(attribute).nil?

      - begin
        = render "cardboard/fields/#{field.type}", f: w 
      - rescue ActionView::MissingTemplate => e
        = render "cardboard/fields/base_input", f: w

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cardboard_cms-0.1.8 app/views/cardboard/pages/_subpart_fields.html.slim
cardboard_cms-0.1.6 app/views/cardboard/pages/_subpart_fields.html.slim
cardboard_cms-0.1.4 app/views/cardboard/pages/_subpart_fields.html.slim