add a before_filter
in ApplicationController
Capture http_referer no matter which landing page
-
24-03-2022 - |
Pergunta
Right now, I capture http_referrer within each of my controller actions, such as:
class PostsController < ApplicationController
def new
referer = request.referer
end
However, I would like to capture the referer no matter which page use lands on. How should I do that? One idea I have is to override ApplicationController to capture and save it to session. But I am not sure if this is a good way to do it.
Thank you.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow