You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
I noticed the default visit option changed from advance to replace, I don't understand in which use case that would be desirable.
To my understanding visit_location_with_turbolinks is only executed for xhr requests which aren't GETs , thus never triggered by Turbolinks.visit.
That means that calling Turbolinks.visit(location, "replace") will override the history location of the XHR request with the redirection target and navigating back will skip the page that issued the XHR request.
I would expect the default to still be advance, because the location of the XHR call is never put in the browser location history.
The text was updated successfully, but these errors were encountered:
Defaulting to "replace" breaks back button on form submit. Instead of going back to the form - local form behavior - it goes to the page before the form.
Agreed. For future reference, I got around this by wrapping redirect_to in my ApplicationController as follows:
# override Turbolinks.redirect_to to make "advance" the defaultdefredirect_to(url={},options={})options[:turbolinks]="advance"unlessoptions.key?(:turbolinks)super(url,options)end
It feels like it would be useful to make this configurable, maybe with new installs having the new default (just switching the default might be too much of a change). However that sounds like it would need to have a proper test suite for this. Are any maintainers/contributors around to give a point of view?
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I noticed the default visit option changed from advance to replace, I don't understand in which use case that would be desirable.
To my understanding visit_location_with_turbolinks is only executed for xhr requests which aren't GETs , thus never triggered by Turbolinks.visit.
That means that calling
Turbolinks.visit(location, "replace")
will override the history location of the XHR request with the redirection target and navigating back will skip the page that issued the XHR request.I would expect the default to still be
advance
, because the location of the XHR call is never put in the browser location history.The text was updated successfully, but these errors were encountered: