From 5477495a8ae1e84f575d2b505975970021e8b9c6 Mon Sep 17 00:00:00 2001 From: Stanley Date: Tue, 20 Aug 2024 18:09:31 +0800 Subject: [PATCH] Fix delete confirmation with new Rails syntax; Change default delete confirmation to "Are you sure" translation --- app/helpers/application_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 79999b63c..18d3faeb1 100755 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -115,13 +115,13 @@ def link_to_edit(record, options = {}) #---------------------------------------------------------------------------- def link_to_delete(record, options = {}) - confirm = options[:confirm] || nil + confirm = options[:confirm] || t(:confirm_delete, record.class.to_s.downcase) link_to(t(:delete) + "!", options[:url] || url_for(record), method: :delete, remote: true, - confirm: confirm) + data: { confirm: confirm}) end #----------------------------------------------------------------------------