Skip to content

Commit 9412854

Browse files
kinsomicroteflavorjones
authored andcommitted
generator: sync erb template to use Rails 7.0 APIs
This updates the erb template to be in sync with the template in rails/rails
1 parent d05daf4 commit 9412854

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

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" %>

0 commit comments

Comments
 (0)