From 5631b021575b8e0850b4455a0e9fb1206dc96f21 Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Wed, 13 Mar 2024 13:56:10 -0700 Subject: [PATCH] Fix confirmation prompts for various actions These were depending on the `rails-ujs` scripts we haven't had in here for a while! Now, they use the new equivalent Turbo attributes. --- app/views/closet_lists/_closet_list.html.haml | 6 ++++-- app/views/outfits/_outfit.html.haml | 11 +++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/views/closet_lists/_closet_list.html.haml b/app/views/closet_lists/_closet_list.html.haml index a15af51a..bdc7f7c3 100644 --- a/app/views/closet_lists/_closet_list.html.haml +++ b/app/views/closet_lists/_closet_list.html.haml @@ -8,10 +8,12 @@ .closet-list-controls = link_to t('.edit'), edit_user_closet_list_path(closet_list.user_id, closet_list) = form_tag user_closet_list_path(closet_list.user_id, closet_list), :method => 'delete' do - = submit_tag t('.delete'), :confirm => closet_list_delete_confirmation(closet_list) + = submit_tag t('.delete'), + data: {turbo_confirm: closet_list_delete_confirmation(closet_list)} = form_tag user_closet_hangers_path(@user), method: :delete, class: 'remove-all' do = hidden_field_tag :list_id, closet_list.id - = submit_tag t('.remove_all.submit'), confirm: t('.remove_all.confirm') + = submit_tag t('.remove_all.submit'), + data: {turbo_confirm: t('.remove_all.confirm')} %button.select-all= t('.select_all') %h4= closet_list.name diff --git a/app/views/outfits/_outfit.html.haml b/app/views/outfits/_outfit.html.haml index 13656983..cb85ef65 100644 --- a/app/views/outfits/_outfit.html.haml +++ b/app/views/outfits/_outfit.html.haml @@ -4,11 +4,10 @@ %header .outfit-star - = link_to outfit.name, outfit, :class => 'outfit-name' + = link_to outfit.name, outfit, class: 'outfit-name' %footer - = link_to t('.edit'), outfit, :class => 'outfit-edit-link' - = button_to t('.delete'), outfit, :method => 'delete', - :class => 'outfit-delete-button', - :confirm => t('.delete_confirmation', - :outfit_name => outfit.name) + = link_to t('.edit'), outfit, class: 'outfit-edit-link' + = button_to t('.delete'), outfit, method: 'delete', + class: 'outfit-delete-button', + data: {turbo_confirm: t('.delete_confirmation', outfit_name: outfit.name)}