Add confirm pop-up in Rails 7
11 March 2022 (Updated 24 April 2022)
Assuming you have turbo-rails
installed and configured, as is the default in Rails 7, you can use:
%= link_to 'Delete', note_path(note),
class: 'btn btn-sm btn-outline-danger',
data: { 'turbo-method': :delete, 'turbo-confirm': 'Are you sure?' } %>
Sources
Tagged:
Rails
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment