I have a form inside a <turbo-frame id=‘modal’> tag. I render into this any forms that need displaying.
The forms have a stimulus controller attached that shows the modal on connect.
One form captures a barcode, and upon submission I want to find the item associated with the barcode and simply redirect to a show page for it.
However, I cannot figure out how to do this. I’ve tried just about every permutation of targets, gets/posts and statuses etc… the best I’ve managed is to have the redirect be rendered, but not replace the URL or entire page.
I gave up on this a while ago and simply served a bespoke turbo_stream action that I handle and redirect, but it’s always bugged me and I’d like to figure out the right way to do this.
Is this possible without taking the form out of a turbo frame (which I wouldn’t like to do if possible as I use the frame population to show the modal forms) ?