Skip to content

Commit cc22bca

Browse files
authored
Merge pull request #359 from rails/update-templates-to-rails-7.0
generator: sync erb template to use Rails 7.0 APIs
2 parents d05daf4 + 3bf5cb9 commit cc22bca

File tree

9 files changed

+10
-27
lines changed

9 files changed

+10
-27
lines changed

.github/workflows/ci.yml

-18
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,6 @@ jobs:
3333
- name: Run tests
3434
run: bin/test
3535

36-
rails6:
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v4
40-
- run: rm Gemfile.lock
41-
- uses: ruby/setup-ruby@v1
42-
with:
43-
ruby-version: "3.2"
44-
bundler: latest
45-
- name: "Pin to Rails 6.1"
46-
run: |
47-
bundle remove actionmailer
48-
bundle add actionmailer --version "~> 6.1" --skip-install
49-
bundle add railties --version "~> 6.1" --skip-install
50-
bundle install
51-
- name: Run tests
52-
run: bin/test
53-
5436
user-journey:
5537
strategy:
5638
fail-fast: false

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## unreleased
22

3-
* Bring the scaffold templates up to date with rails/rails as much as possible without breaking 6.1 compatibility. (#357) @kinsomicrote
3+
* Bring the scaffold templates up to date with rails/rails. (#357, #359) @kinsomicrote
44
* Drop support for Rails 6.0, which reached end-of-life in June 2023.
5+
* Drop feature and bug fix support for Rails 6.1. The previous minor release will still receive security support while Rails 6.1 is supported.
56

67

78
## v2.5.0 / 2024-04-27

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ gemspec
55
gem "debug", ">= 1.0.0"
66

77
group :test do
8-
gem "actionmailer", ">= 6.1.0"
8+
gem "actionmailer", ">= 7.0.0"
99
end

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: .
33
specs:
44
tailwindcss-rails (2.5.0)
5-
railties (>= 6.1.0)
5+
railties (>= 7.0.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -141,7 +141,7 @@ PLATFORMS
141141
x86_64-linux
142142

143143
DEPENDENCIES
144-
actionmailer (>= 6.1.0)
144+
actionmailer (>= 7.0.0)
145145
debug (>= 1.0.0)
146146
tailwindcss-rails!
147147

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<%%= render "form", <%= singular_table_name %>: @<%= singular_table_name %> %>
55

66
<%%= 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" %>
7-
<%%= 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" %>
7+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :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

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<%% @<%= plural_table_name %>.each do |<%= singular_table_name %>| %>
1515
<%%= render <%= singular_table_name %> %>
1616
<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" %>
17+
<%%= link_to "Show this <%= human_name.downcase %>", <%= model_resource_name(singular_table_name) %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
1818
</p>
1919
<%% end %>
2020
</div>

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

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

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

6-
<%%= 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" %>
6+
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper(type: :path) %>, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
77
</div>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

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

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" %>
9+
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
1010
<%%= 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" %>
1111
<div class="inline-block ml-2">
1212
<%%= 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" %>

tailwindcss-rails.gemspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ Gem::Specification.new do |spec|
2020
spec.bindir = "exe"
2121
spec.executables << "tailwindcss"
2222

23-
spec.add_dependency "railties", ">= 6.1.0"
23+
spec.add_dependency "railties", ">= 7.0.0"
2424
end

0 commit comments

Comments
 (0)