<% 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 -%>