Disable Turbo, but retain confirmation popup for link in turbo-frame

link_to ‘link’, link_path, data: { turbo_method: :get, turbo_confirm: "confirmation message”}

when clicked triggers a confirmation popup message, but

link_to ‘link’, link_path, data: { turbo: false, turbo_method: :get, turbo_confirm: "confirmation message”}

appears not to. I’ve tried a few variations like:

link_to ‘link’, link_path, data: { turbo: false, method: :get, confirm: "confirmation message”}

but not found a solution.

Is there a simple way to disable turbo, but retain the confirmation popup for a link in a turbo-frame?

No, if you disable turbo for that link none of the turbo_ data attributes work, including turbo_confirm. You either need to use turbo or write the custom JS yourself, using something like stimulus.

1 Like

Thanks @marco-beduschi for confirming.

The Stimulus solution proved to be pretty straightforward, as described here

I now I have a link in a turbo-frame with turbo set to false and a working confirmation pop-up!

1 Like