Skip to content

Commit 7d80a2b

Browse files
committed
Remove unused css classes and sanitize table a bit.
1 parent e48dc28 commit 7d80a2b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/templates/erb/scaffold/_form.html.erb.tt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
<%% end %>
1313

1414
<% attributes.each do |attribute| -%>
15-
<div class="field my-5">
15+
<div class="my-5">
1616
<% if attribute.password_digest? -%>
1717
<%%= form.label :password %>
1818
<%%= form.password_field :password %>
1919
</div>
2020

21-
<div class="field my-5">
21+
<div class="my-5">
2222
<%%= form.label :password_confirmation %>
2323
<%%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-200 outline-none px-3 py-2 mt-2 w-full" %>
2424
<% elsif attribute.attachments? -%>
@@ -37,7 +37,7 @@
3737
</div>
3838

3939
<% end -%>
40-
<div class="actions inline">
40+
<div class="inline">
4141
<%%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium" %>
4242
</div>
43-
<%% end %>
43+
<%% end %>

lib/templates/erb/scaffold/index.html.erb.tt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,19 @@
1414
<% attributes.reject(&:password_digest?).each do |attribute| -%>
1515
<th class="pt-6 pb-2 font-normal"><%= attribute.human_name %></th>
1616
<% end -%>
17+
<th></th>
1718
</tr>
1819
</thead>
1920

2021
<tbody>
2122
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
22-
<tr class="align-top border-b border-gray-200">
23+
<tr class="align-middle border-b border-gray-200">
2324
<% attributes.reject(&:password_digest?).each do |attribute| -%>
24-
<td class="py-6 pr-3"><%%= <%= singular_table_name %>.<%= attribute.column_name %> %></td>
25+
<td class="py-4 pr-3"><%%= <%= singular_table_name %>.<%= attribute.column_name %> %></td>
2526
<% end -%>
26-
<td class="py-6 pr-3"><%%= link_to 'Show', <%= model_resource_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %></td>
27-
<td class="py-6 pr-3"><%%= link_to 'Edit', edit_<%= singular_route_name %>_path(<%= singular_table_name %>), class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %></td>
27+
<td class="py-4 pr-3 float-right">
28+
<%%= link_to 'Show', <%= model_resource_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
29+
</td>
2830
</tr>
2931
<%% end %>
3032
</tbody>

0 commit comments

Comments
 (0)