<%%= form_for(<%= singular_table_name %>) do |f| %>
  <%% if <%= singular_table_name %>.errors.any? %>
    <div id="error_explanation">
      <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>

      <ul>
      <%% <%= singular_table_name %>.errors.full_messages.each do |message| %>
        <li><%%= message %></li>
      <%% end %>
      </ul>
    </div>
  <%% end %>

<% attributes.each do |attribute| -%>
  <div class="field">
<% if attribute.password_digest? -%>
    <%%= f.label :password %>
    <%%= f.password_field :password %>
  </div>

  <div class="field">
    <%%= f.label :password_confirmation %>
    <%%= f.password_field :password_confirmation %>
<% else -%>
    <%%= f.label :<%= attribute.column_name %> %>
    <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %> %>
<% end -%>
  </div>

<% end -%>
  <div class="actions">
    <%%= f.submit %>
  </div>
<%% end %>
