From c8d6569f8a7b8b4e1dfb28f634b0713dfaf0aea5 Mon Sep 17 00:00:00 2001 From: hatz Date: Fri, 2 May 2025 19:56:42 -0500 Subject: [PATCH] Clean up deletion resource names --- app/helpers/custom_confirm.rb | 2 +- app/views/accounts/show/_menu.html.erb | 2 +- app/views/chats/_chat.html.erb | 2 +- app/views/chats/_chat_nav.html.erb | 2 +- app/views/imports/_import.html.erb | 2 +- app/views/rules/_rule.html.erb | 2 +- app/views/rules/index.html.erb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/helpers/custom_confirm.rb b/app/helpers/custom_confirm.rb index 5ea90c91..858db155 100644 --- a/app/helpers/custom_confirm.rb +++ b/app/helpers/custom_confirm.rb @@ -6,7 +6,7 @@ class CustomConfirm new( destructive: true, high_severity: high_severity, - title: "Delete #{resource_name.downcase}?", + title: "Delete #{resource_name.titleize}?", body: "Are you sure you want to delete #{resource_name.downcase}? This is not reversible.", btn_text: "Delete #{resource_name.downcase}" ) diff --git a/app/views/accounts/show/_menu.html.erb b/app/views/accounts/show/_menu.html.erb index 5e59c88a..56d78f62 100644 --- a/app/views/accounts/show/_menu.html.erb +++ b/app/views/accounts/show/_menu.html.erb @@ -19,7 +19,7 @@ href: account_path(account), method: :delete, icon: "trash-2", - confirm: CustomConfirm.for_resource_deletion("Account", high_severity: true), + confirm: CustomConfirm.for_resource_deletion("account", high_severity: true), data: { turbo_frame: :_top } ) %> <% end %> diff --git a/app/views/chats/_chat.html.erb b/app/views/chats/_chat.html.erb index 79e02b73..fd904de1 100644 --- a/app/views/chats/_chat.html.erb +++ b/app/views/chats/_chat.html.erb @@ -17,6 +17,6 @@ href: chat_path(chat), icon: "trash-2", method: :delete, - confirm: CustomConfirm.for_resource_deletion("Chat")) %> + confirm: CustomConfirm.for_resource_deletion("chat")) %> <% end %> <% end %> diff --git a/app/views/chats/_chat_nav.html.erb b/app/views/chats/_chat_nav.html.erb index 47e56c8e..9faa2e5a 100644 --- a/app/views/chats/_chat_nav.html.erb +++ b/app/views/chats/_chat_nav.html.erb @@ -29,7 +29,7 @@ href: chat_path(chat), icon: "trash-2", method: :delete, - confirm: CustomConfirm.for_resource_deletion("Chat")) %> + confirm: CustomConfirm.for_resource_deletion("chat")) %> <% end %> <% end %> diff --git a/app/views/imports/_import.html.erb b/app/views/imports/_import.html.erb index fca4764b..a0b1d965 100644 --- a/app/views/imports/_import.html.erb +++ b/app/views/imports/_import.html.erb @@ -59,7 +59,7 @@ href: import_path(import), icon: "trash-2", method: :delete, - confirm: CustomConfirm.for_resource_deletion("Import")) %> + confirm: CustomConfirm.for_resource_deletion("import")) %> <% end %> <% end %> diff --git a/app/views/rules/_rule.html.erb b/app/views/rules/_rule.html.erb index 0a19d9b3..e2b01b74 100644 --- a/app/views/rules/_rule.html.erb +++ b/app/views/rules/_rule.html.erb @@ -55,7 +55,7 @@ href: rule_path(rule), icon: "trash-2", method: :delete, - confirm: CustomConfirm.for_resource_deletion("Rule")) %> + confirm: CustomConfirm.for_resource_deletion("rule")) %> <% end %> diff --git a/app/views/rules/index.html.erb b/app/views/rules/index.html.erb index 13e538b4..2c3040a1 100644 --- a/app/views/rules/index.html.erb +++ b/app/views/rules/index.html.erb @@ -10,7 +10,7 @@ href: destroy_all_rules_path, icon: "trash-2", method: :delete, - confirm: CustomConfirm.for_resource_deletion("All rules", high_severity: true)) %> + confirm: CustomConfirm.for_resource_deletion("all rules", high_severity: true)) %> <% end %> <% end %>