Sha256: 201033b968039799b4745340a11ef1034871ef4c7b5b8b74d910433d33a71dce

Contents?: true

Size: 855 Bytes

Versions: 2

Compression:

Stored size: 855 Bytes

Contents

.nested-fields
  = f.hidden_field :identifier, :value => part_identifier

  - if part_hash[:repeatable]
    .right= link_to_remove_association "x", f, class: "btn btn-danger"

  - part_hash[:fields].each do |field_identifier, field|
       
    - fields = part.fields.find{|ob|  ob.identifier ==  field_identifier}
    - fields = part.fields.build(type: "Cardboard::Field::#{field[:type].camelize}", identifier: field_identifier, default: field[:default] ) if fields.blank?
   
    = f.simple_fields_for :fields,  fields do |w|
      = w.hidden_field :type
      = w.hidden_field :identifier

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cardboard_cms-0.3.1 app/views/cardboard/pages/_part_fields.html.slim
cardboard_cms-0.2.2 app/views/cardboard/pages/_part_fields.html.slim