|
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-lg mt-3"> |
| 3 | + <div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-md mt-3"> |
4 | 4 | <h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5 | 5 |
|
6 |
| - <ul> |
| 6 | + <ul class="list-disc ml-6"> |
7 | 7 | <%% <%= singular_table_name %>.errors.each do |error| %>
|
8 | 8 | <li><%%= error.full_message %></li>
|
9 | 9 | <%% end %>
|
|
15 | 15 | <div class="my-5">
|
16 | 16 | <% if attribute.password_digest? -%>
|
17 | 17 | <%%= form.label :password %>
|
18 |
| - <%%= form.password_field :password, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> |
19 |
| -</div> |
| 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?}] %> |
| 19 | + </div> |
20 | 20 |
|
21 |
| -<div class="my-5"> |
| 21 | + <div class="my-5"> |
22 | 22 | <%%= form.label :password_confirmation %>
|
23 |
| - <%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> |
| 23 | + <%%= form.password_field :password_confirmation, 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_confirmation].none?, "border-red-400 focus:outline-red-600": <%= model_resource_name %>.errors[:password_confirmation].any?}] %> |
24 | 24 | <% elsif attribute.attachments? -%>
|
25 | 25 | <%%= form.label :<%= attribute.column_name %> %>
|
26 |
| - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> |
| 26 | + <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, 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?}] %> |
27 | 27 | <% else -%>
|
28 | 28 | <%%= form.label :<%= attribute.column_name %> %>
|
29 | 29 | <% if attribute.field_type == :textarea || attribute.field_type == :text_area -%>
|
30 |
| - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> |
| 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 border-gray-400 outline-none focus:outline-blue-600 mt-2 h-5 w-5" %> |
| 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?}] %> |
33 | 33 | <% else -%>
|
34 |
| - <%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-400 outline-none focus:outline-blue-600 px-3 py-2 mt-2 w-full" %> |
| 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 -%>
|
36 | 36 | <% end -%>
|
37 | 37 | </div>
|
38 | 38 |
|
39 | 39 | <% end -%>
|
40 | 40 | <div class="inline">
|
41 |
| - <%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %> |
| 41 | + <%%= form.submit class: "rounded-md px-3.5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white inline-block font-medium cursor-pointer" %> |
42 | 42 | </div>
|
43 | 43 | <%% end %>
|
0 commit comments