module Turbolinks::XHRHeaders

Private Instance Methods

_compute_redirect_to_location_with_xhr_referer(options) click to toggle source
# File lib/turbolinks.rb, line 10
def _compute_redirect_to_location_with_xhr_referer(options)
  session[:_turbolinks_redirect_to] =
    if options == :back && request.headers["X-XHR-Referer"]
      _compute_redirect_to_location_without_xhr_referer(request.headers["X-XHR-Referer"])
    else
      _compute_redirect_to_location_without_xhr_referer(options)
    end
end
set_xhr_redirected_to() click to toggle source
# File lib/turbolinks.rb, line 19
def set_xhr_redirected_to
  if session[:_turbolinks_redirect_to]
    response.headers['X-XHR-Redirected-To'] = session.delete :_turbolinks_redirect_to
  end
end