In a Rails 7 app, I am trying to ask the user to confirm before destroying a resource.
In my erb view, I have the following tag:
<%= button_to 'Destroy', account_path(@account), method: :delete, data: { turbo_confirm: "Are you sure?" } %>
That generates the following HTML
<form class="button_to" method="post" action="/accounts/483786005">
<input type="hidden" name="_method" value="delete" autocomplete="off">
<button data-turbo-confirm="Are you sure?" type="submit">Destroy</button>
<input type="hidden" name="authenticity_token" value="5shu7zu1uzqtFf-XZryoyLjXXmheOP6lWxSOPvxYhmjX7Pa1m9RxGKzvb9BeehbHqs4s_o4_SHWSBDwSi5Hr3A" autocomplete="off">
</form>
But when I click the button, the resource is destroyed without the prompt.
What can be wrong? How can I debug this?
Extra info:
- I am using Rails 7.0.2.3 with turbo-rails 1.0.1
- Turbo tags works fine, so the js library is being called.