Module: Turbolinks::Redirect::Concern

Defined in:
lib/turbolinks/redirect.rb

Overview

All methods that will be included in ActionController::Base.

Instance Method Summary collapse

Instance Method Details

#redirect_to(options = {}, response_status = {}) ⇒ Object

Override #redirect_to to automatically respond with a status of :turbolinks if this request is AJAX.



24
25
26
27
28
29
30
# File 'lib/turbolinks/redirect.rb', line 24

def redirect_to( options={}, response_status={} )
  if request.xhr?
    super options, response_status.merge( :status => :turbolinks )
  else
    super
  end
end