I am using a turbo-frame to render a small edit view within a popover.
It works pretty well, to handle the update of it (including the redirect), as well as displaying possible errors within the form.
What doesn’t work is, when I tried to add a delete button within that popover->turbo-frame.
The delete button is just a rails_ujs link with
This is what happens: The deletion request itself works well. Afterwards the controller redirects to the index action, what is valid behaviour. But the redirect isn’t performed within the turbo-frame (as it is in the create&update case), but within the whole application.
I also tried to influence that behaviour using the target option in tag, but without any impact.
Of course it seems, that rails_ujs doesnt work properly with turbo - as I can see, that turbo is actually performing the redirection within its FormSubmitObserver .
And for me it seems, that rails_ujs might not be the best way of doing this anymore… is it?
So, if I’m not doing any detail wrong in my implementation, I am actually wondering, what would be the correct (new) way to submit destroy-method-requests in links, like earlier with rails_ujs, but respecting the new Turbo infrastructure?
Thanks for your help!