When a user navigates to a page but is not logged in, he is redirected back to my login page.
def authenticate_user!
redirect_to new_user_path unless current_user
end
Then in my user manager
class UsersController < ApplicationController
skip_before_filter :authenticate_user!, only: [:new, :create]
def new
puts request.referer
puts request.referrer
puts request["HTTP_REFERER"]
puts request["HTTP_REFERRER"]
...
end
end
I don’t get anything from variables referrerwhen I go to another page (but it redirects to /users/newcorrectly). Even with a direct transition to the page, /users/newI get nothing for any of these variables. How do I get the path from which they came? I saw examples using the code below, but referrershould not be nil
previous = Rails.application.routes.recognize_path(request.referer)
source
share