Skip to content

Commit 0c1aa5f

Browse files
authored
Merge branch 'main' into flavorjones-dep-drop-rails-6.0-support
2 parents da8cd6e + b6cb812 commit 0c1aa5f

File tree

6 files changed

+27
-11
lines changed

6 files changed

+27
-11
lines changed

.github/dependabot.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "bundler"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"
11+
groups:
12+
github-actions:
13+
applies-to: version-updates

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
## next / unreleased
1+
## unreleased
22

3+
* Bring the scaffold templates up to date with rails/rails as much as possible without breaking 6.1 compatibility. (#357) @kinsomicrote
34
* Drop support for Rails 6.0, which reached end-of-life in June 2023.
45

56

lib/generators/tailwindcss/scaffold/templates/edit.html.erb.tt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
55

6-
<%%= link_to "Show this <%= human_name.downcase %>", @<%= singular_table_name %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
6+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
77
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
88
</div>

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@
33
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%%= notice %></p>
44
<%% end %>
55

6+
<%% content_for :title, "<%= human_name.pluralize %>" %>
7+
68
<div class="flex justify-between items-center">
79
<h1 class="font-bold text-4xl"><%= human_name.pluralize %></h1>
810
<%%= link_to "New <%= human_name.downcase %>", new_<%= singular_route_name %>_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
911
</div>
1012

1113
<div id="<%= plural_table_name %>" class="min-w-full">
12-
<%%= render @<%= plural_table_name %> %>
14+
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
15+
<%%= render <%= singular_table_name %> %>
16+
<p>
17+
<%%= link_to "Show this <%= human_name.downcase %>", <%= singular_name %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
18+
</p>
19+
<%% end %>
1320
</div>
1421
</div>

lib/generators/tailwindcss/scaffold/templates/partial.html.erb.tt

-5
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,4 @@
1414
</p>
1515

1616
<% end -%>
17-
<%% if action_name != "show" %>
18-
<%%= link_to "Show this <%= human_name.downcase %>", <%= singular_name %>, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
19-
<%%= link_to "Edit this <%= human_name.downcase %>", edit_<%= singular_name %>_path(<%= singular_name %>), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
20-
<hr class="mt-6">
21-
<%% end %>
2217
</div>

lib/generators/tailwindcss/scaffold/templates/show.html.erb.tt

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66

77
<%%= render @<%= singular_table_name %> %>
88

9-
<%%= link_to "Edit this <%= singular_table_name %>", edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
9+
<%%= link_to "Edit this <%= human_name.downcase %>", edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
10+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
1011
<div class="inline-block ml-2">
11-
<%%= button_to "Destroy this <%= singular_table_name %>", <%= singular_table_name %>_path(@<%= singular_table_name %>), method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
12+
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
1213
</div>
13-
<%%= link_to "Back to <%= plural_table_name %>", <%= index_helper %>_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
1414
</div>
1515
</div>

0 commit comments

Comments
 (0)