Giter Site home page Giter Site logo

Comments (3)

adrianthedev avatar adrianthedev commented on July 20, 2024 2

I have encountered this issue as well and need to set the redirection server-side.

from turbolinks-rails.

jeremy avatar jeremy commented on July 20, 2024 1

From the README:

Note: in v3.0, the default behavior of redirect_to is to redirect via Turbolinks on XHR + non-GET requests. You can opt-out of this behavior by passing turbolinks: false to redirect_to.

Passing turbolinks: false means "return 302 Found to the XHR request" not "redirect the browser location to the new URL as if this hadn't been an XHR request in the first place." If that makes sense 😊

That's why 'data-turbolinks' => false works as you expect. It means you get a browser page load, not an XHR page load, so a 302 Found response does redirect the browser window, not the XHR response.

from turbolinks-rails.

 avatar commented on July 20, 2024

the default behavior of redirect_to is to redirect via Turbolinks on XHR + non-GET requests

This is still a bit confusing as it implies XHR + GET requests wouldn't redirect via Turbolinks.

In the example I've given passing true or passing false yield the same result.

Could you advise on how best to handle cross domain server side redirection on a Turbolinks initiated XHR + GET request?

from turbolinks-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.