<%%= form_for <%= singular_table_name %>, local: true, html: { class: "row" } do |f| %> <%%= render "admin/shared/errors", object: <%= singular_table_name %> %>
<% attributes.each do |attribute| -%> <% if attribute.password_digest? -%>
<%%= f.label :password, t(:password) %> <%%= f.password_field :password, class: "form-control", placeholder: t(:) %>
<%%= f.label :password_confirmation, t(:password_confirmation) %> <%%= f.password_field :password_confirmation, class: "form-control", placeholder: t(:) %>
<% else %>
<% case(attribute.field_type.to_sym) when :text_field %> <%%= f.label :<%= attribute.column_name %>, t(:<%= attribute.column_name.downcase %>) %> <%%= f.text_field :<%= attribute.column_name %>, class: "form-control", placeholder: t(:<%= attribute.column_name.downcase %>) %> <% when :check_box %> <%%= f.check_box :<%= attribute.column_name %> %> <%%= f.label :<%= attribute.column_name %>, t(:<%= attribute.column_name.downcase %>) %> <% when :text_area %> <%%= f.label :<%= attribute.column_name %>, t(:<%= attribute.column_name.downcase %>) %> <%%= f.text_area :<%= attribute.column_name %>, class: "form-control editor", placeholder: t(:<%= attribute.column_name.downcase %>) %> <% else %> <%%= f.label :<%= attribute.column_name %>, t(:<%= attribute.column_name.downcase %>) %> <%%= f.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "form-control", placeholder: t(:<%= attribute.column_name.downcase %>) %> <% end %>
<% end -%> <% end -%>
<%% if f.object.persisted? %> <%%= link_to <%= singular_table_name %>_path(<%= singular_table_name %>), class: "btn btn-outline-danger btn-sm mt-2 mb-2", method: :delete, data: { confirm: "¿Estás seguro de eliminar este #{t(:<%= singular_table_name %>)}?" } do %> <%%= t(:delete) %> <%% end %> <%% end %>
<%% end %>