<h1>Editing <%= singular_name %></h1>

<%% form_for(@<%= singular_name %>) do |f| %>
  <%%= f.error_messages %>

<% for attribute in attributes -%>
  <p>
    <%%= f.label :<%= attribute.name %> %><br />
    <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
  </p>
<% end -%>

  <p>
    <%% f.fields_for :people do |person_form| %>
<% for attribute in child_attributes -%>
      <p>
        <%= child_model_name.humanize %> <%%= <%= child_form_name %>.label :<%= attribute.name %> %><br />
        <%%= <%= child_form_name %>.<%= attribute.field_type %> :<%= attribute.name %> %>
      </p>
<% end -%>
      <%% unless <%= child_form_name %>.object.new_record? %>
        <%%= <%= child_form_name %>.check_box '_delete' %>
        <%%= <%= child_form_name %>.label '_delete', 'Remove' %>
      <%% end %>
    <%% end %>
  </p>

  <p>
    <%%= f.submit 'Update' %>
  </p>
<%% end %>

<%%= link_to 'Show', @<%= singular_name %> %> |
<%%= link_to 'Back', <%= plural_name %>_path %>

<h1>Editing <%= singular_name %></h1>

<%% form_for(@<%= singular_name %>) do |f| %>
  <%%= f.error_messages %>

<% for attribute in attributes -%>
  <p>
    <%%= f.label :<%= attribute.name %> %><br />
    <%%= f.<%= attribute.field_type %> :<%= attribute.name %> %>
  </p>
<% end -%>

  <p>
  <%% f.fields_for :<%= child_plural_name %> do |<%= child_form_name %>| %>
<% for attribute in child_attributes -%>
      <p>
        <%= child_model_name.humanize %> <%%= <%= child_form_name %>.label :<%= attribute.name %> %><br />
        <%%= <%= child_form_name %>.<%= attribute.field_type %> :<%= attribute.name %> %>
      </p>
<% end -%>
      <%% unless <%= child_form_name %>.object.new_record? %>
        <%%= <%= child_form_name %>.check_box '_delete' %>
        <%%= <%= child_form_name %>.label '_delete', 'Remove' %>
      <%% end %>
    <%% end %>
  </p>

  <p>
    <%%= f.submit 'Update' %>
  </p>
<%% end %>

<%%= link_to 'Show', @<%= singular_name %> %> |
<%%= link_to 'Back', <%= plural_name %>_path %>

Remove hard coded :people and person_form
Remove hard coded :people and person_form
