Skip to content

Commit 8c1e12d

Browse files
authored
Merge pull request #498 from patriciomacadden/turbo-confirm-prompt
Add confirm prompt if turbo is available
2 parents db51cda + bf0b18f commit 8c1e12d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<%%= link_to "Show", <%= model_resource_name(singular_table_name) %>, class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
2020
<%%= link_to "Edit", <%= edit_helper(singular_table_name, type: :path) %>, class: "rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
2121
<div class="inline-block">
22-
<%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium" %>
22+
<%%= button_to "Destroy", <%= model_resource_name %>, method: :delete, class: "rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
2323
</div>
2424
</div>
2525
</div>

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
<%%= link_to "Edit this <%= human_name.downcase %>", <%= edit_helper(type: :path) %>, class: "mt-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
1313
<%%= link_to "Back to <%= human_name.pluralize.downcase %>", <%= index_helper %>_path, class: "ml-2 rounded-md px-3.5 py-2.5 bg-gray-100 hover:bg-gray-50 inline-block font-medium" %>
1414
<div class="inline-block ml-2">
15-
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium" %>
15+
<%%= button_to "Destroy this <%= human_name.downcase %>", <%= model_resource_name(prefix: "@") %>, method: :delete, class: "mt-2 rounded-md px-3.5 py-2.5 text-white bg-red-600 hover:bg-red-500 font-medium cursor-pointer", data: { turbo_confirm: "Are you sure?" } %>
1616
</div>
1717
</div>

0 commit comments

Comments
 (0)