Tiago Ameller PRO said over 4 years ago on SweetAlerts in Rails 6 :
Interesting. Despite your approach is weird, is good to have a solution for when I upgrade my app to v6. I need to enhance my js skills before upgrading ;-)