app/controllers/application_controller.rb
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception.
For APIs, you may want to use :null_session instead.
Prevent CSRF attacks by raising an exception . For APIs you may want to use : null_session instead .
def redirect_to_path
    new_path = session[:return_to]
    session[:return_to] = nil
    new_path || root_url
  end
def redirect_to_path new_path = session [ :return_to ] session [ :return_to ] = nil new_path || root_url end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .