module Turbolinks::LegacyXHRRedirect
TODO: Remove me when support for Ruby < 2 && Rails < 4 is dropped
Public Class Methods
included(base)
click to toggle source
# File lib/turbolinks/xhr_redirect.rb, line 16 def self.included(base) base.alias_method_chain :call, :turbolinks end
Public Instance Methods
call_with_turbolinks(env)
click to toggle source
# File lib/turbolinks/xhr_redirect.rb, line 20 def call_with_turbolinks(env) status, headers, body = call_without_turbolinks(env) if env['rack.session'] && env['HTTP_X_XHR_REFERER'] env['rack.session'][:_turbolinks_redirect_to] = headers['Location'] end [status, headers, body] end