|
1 | 1 | <%%= form_with(model: <%= model_resource_name %>, class: "contents") do |form| %>
|
2 | 2 | <%% if <%= singular_table_name %>.errors.any? %>
|
3 |
| - <div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3"> |
| 3 | + <div id="error_explanation" class="px-3 py-2 mt-3 font-medium text-red-500 rounded-md bg-red-50"> |
4 | 4 | <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5 | 5 |
|
6 |
| - <ul class="list-disc ml-6"> |
| 6 | + <ul class="ml-6 list-disc"> |
7 | 7 | <%% <%= singular_table_name %>.errors.each do |error| %>
|
8 | 8 | <li><%%= error.full_message %></li>
|
9 | 9 | <%% end %>
|
|
12 | 12 | <%% end %>
|
13 | 13 |
|
14 | 14 | <% attributes.each do |attribute| -%>
|
15 |
| - <div class="my-5"> |
| 15 | + <div class="my-5<%= " flex items-center gap-2" if attribute.field_type == :checkbox || attribute.field_type == :check_box %>"> |
16 | 16 | <% if attribute.password_digest? -%>
|
17 | 17 | <%%= form.label :password %>
|
18 | 18 | <%%= form.password_field :password, class: ["block shadow rounded-md border outline-none px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:password].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password].any?}] %>
|
|
29 | 29 | <% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
|
30 | 30 | <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: ["block shadow rounded-md border outline-none px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
|
31 | 31 | <% elsif attribute.field_type == :checkbox || attribute.field_type == :check_box -%>
|
32 |
| - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow rounded-md border outline-none mt-2 h-5 w-5", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %> |
| 32 | + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow rounded-md border outline-none order-first h-5 w-5", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %> |
33 | 33 | <% else -%>
|
34 | 34 | <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: ["block shadow rounded-md border outline-none px-3 py-2 mt-2 w-full", {"border-gray-400 focus:outline-blue-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:<%= attribute.column_name %>].any?}] %>
|
35 | 35 | <% end -%>
|
|
0 commit comments