<%%= form_with(model: <%= model_resource_name %>) do |form| %> <% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%> <%%= form.label :password, class: "form-label col-md-3 col-form-label" %>
<%%= form.password_field :password, required: true, autocomplete: "new-password", class: "form-control" %> <%%= tag.div <%= singular_name %>.errors[:password].first, class: "invalid-feedback" %>
<%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", class: "form-control" %> <%%= tag.div <%= singular_name %>.errors[:password_confirmation].first, class: "invalid-feedback" %> <% elsif attribute.attachments? -%> <%%= form.label :<%= attribute.column_name %>, class: "form-label col-md-3 col-form-label" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "form-control" %> <%%= tag.div <%= singular_name %>.errors[:<%= attribute.column_name %>].first, class: "invalid-feedback" %>
<% elsif attribute.field_type == :check_box -%> <%%= form.label :<%= attribute.column_name %>, class: "form-check-label col-md-3 col-form-label" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "form-check-input" %> <%%= tag.div <%= singular_name %>.errors[:<%= attribute.column_name %>].first, class: "invalid-feedback" %>
<% else -%> <%%= form.label :<%= attribute.column_name %>, class: "form-label col-md-3 col-form-label" %>
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "form-control" %> <%%= tag.div <%= singular_name %>.errors[:<%= attribute.column_name %>].first, class: "invalid-feedback" %>
<% end -%>
<% end -%> <%% end %>