Add action confirmation dialog

This commit is contained in:
2023-05-14 17:57:20 +02:00
parent e4f595a329
commit f76344c220
3 changed files with 5 additions and 4 deletions

View File

@@ -87,6 +87,9 @@ module ApplicationHelper
name = svg_tag("pictograms/#{image}") + name if image
html_options[:class] = class_names(html_options[:class], "button", active: current == :active)
if html_options[:confirm]
html_options[:onclick] = "return confirm('#{html_options.delete(:confirm)}');"
end
send "#{type}_to", name, options, html_options
end