%%= form_with(model: <%= model_resource_name %>, html: { contents: true }) do |form| %>
<%% if <%= singular_table_name %>.errors.any? %>
<%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:
<%% <%= singular_table_name %>.errors.each do |error| %>
- <%%= error.full_message %>
<%% end %>
<%% end %>
<% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%>
<%%= form.label :password, class: "text-sm font-medium leading-none" %>
<%%= form.password_field :password, class: "input" %>
<%%= form.label :password_confirmation, class: "text-sm font-medium leading-none" %>
<%%= form.password_field :password_confirmation, class: "input" %>
<% elsif attribute.attachments? -%>
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "input" %>
<% elsif attribute.field_type == :textarea -%>
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: "auto", class: "input" %>
<% elsif attribute.field_type == :checkbox -%>
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "switch" %>
<% else -%>
<%%= form.label :<%= attribute.column_name %>, class: "text-sm font-medium leading-none" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "input" %>
<% end -%>
<% end -%>
<%%= form.submit class: "btn btn--primary" %>
<%% end %>