sajad torkamani

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

Leave a comment

Your email address will not be published. Required fields are marked *