Action `redirect_to` should use Turbo by default
See original GitHub issueCurrently you need to pass turbo="true"
to the <turbo-stream>
element in order that is uses Turbo.visit()
:
<turbo-stream turbo="true" url="http://localhost:3000/" action="redirect_to"><template></template></turbo-stream>
It should use Turbo.visit()
by default unless turbo="false"
gets explicitly passed to the stream element.
The action already accounts for when Turbo/Turbolinks is not installed in the application and will fallback to window.location.href = url
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Redirect to new page on successful form submission ... - GitHub
I'm trying to figure out how to do this. Right now, when I submit a form from within a turbo_frame_tag , I'm reliant...
Read more >Custom Form Handling With Turbo - Source Diving
If the response is a redirect, Turbo will follow that redirect, navigating to the new page (without a full page load) as if...
Read more >Redirect after Turbo stream response - Hotwire Discussion
A solution for me was to add a data-controller=“redirect” and set the URL value on the wrapping div from flash message. The path...
Read more >HTTP redirects in a Turbo-Rails app - DEV Community
The reason behind this is the spec for 302 Found states that the redirected request should use the same HTTP method as the...
Read more >conditionally respond with html OR turbo_stream
Sometimes you want the same action to respond to different formats. ... it will respond with format turbo_stream by default!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pySilver this was resolved via #22 and was released as part of 0.1.6
@marcoroth thank you for your work!