<% page = f.object %>
  • <%= t :drag %>
    <%= f.hidden_field :id %> <%= f.hidden_field :weight, data: {property: "weight"} %>

    <%= f.check_box :published, inline: true, hide_label: true %> <%= page.title %> <%= f.hidden_field :title, value: page.title , class: 'form-control form-control-sm title-field', data: {:"edit-field-target" => 'true'} %>

    <%- if page.feature_page? -%> <%= f.hidden_field :parent_page_id, data: {property: "parent_page"} %> <% end %>
    <% if page.feature_page? and page.child_pages.present? %>
      <% page.child_pages.each do |child_page| %> <%= parent_form.fields_for page_collection_name, child_page do |p| %> <%= render partial: 'page', locals: {f: p, parent_form: parent_form} %> <% end %> <% end %>
    <% end %>