.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