<%%= form_for(@<%= singular_table_name %>) do |f| %> <%%= errors_bar @<%= singular_table_name %> %>
<% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%> <%%= f.label :password %> <%%= f.password_field :password, class: 'form-control' %>
<%%= f.label :password_confirmation %> <%%= f.password_field :password_confirmation, class: 'form-control' %> <% else -%> <%- if attribute.reference? -%> <%%= f.label :<%= attribute.column_name %> %> <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %>, class: 'form-control' %> <%- else -%> <%%= f.label :<%= attribute.name %> %> <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'form-control' %> <%- end -%> <% end -%>
<% end -%>
<%%= f.submit 'Save', class: 'btn btn-primary' %> <%%= link_to 'Cancel', <%= index_helper %>_path, class: 'btn btn-default' %> <%% end %>