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 store_location
  return unless request.get?
  if (request.path != "/users/sign_in" &&
      request.path != "/users/sign_up" &&
      request.path != "/users/password/new" &&
      request.path != "/users/password/edit" &&
      request.path != "/users/confirmation" &&
      request.path != "/users/sign_out" &&
      !request.xhr?) 
    session[:previous_url] = request.fullpath
  end
end
def store_location return unless request . get? if ( request . path != "/users/sign_in" && request . path != "/users/sign_up" && request . path != "/users/password/new" && request . path != "/users/password/edit" && request . path != "/users/confirmation" && request . path != "/users/sign_out" && ! request . xhr? ) session [ :previous_url ] = request . fullpath end end
Prevent CSRF attacks by raising an exception.
Prevent CSRF attacks by raising an exception .
# store last url - this is needed for post-login redirect to whatever the user last visited. # don't store ajax calls