Method: Sorcery::Controller::InstanceMethods#redirect_back_or_to

Defined in:
lib/sorcery/controller.rb

#redirect_back_or_to(url, flash_hash = {}) ⇒ Object

used when a user tries to access a page while logged out, is asked to login, and we want to return him back to the page he originally wanted.



89
90
91
92
# File 'lib/sorcery/controller.rb', line 89

def redirect_back_or_to(url, flash_hash = {})
  redirect_to(session[:return_to_url] || url, :flash => flash_hash)
  session[:return_to_url] = nil
end