In rails whats the best way to get the site that a user came from? I am getting conflicting info.
- by kidbrax
If i enter a url directly into the address bar of the browser, i get the following results:
logger.debug ENV['HTTP_REFERER'] // =>
logger.debug request.referrer // => /
So the first one gives me a blank result which is what I expected but the second gives me the root? Is this correct? It seems from the docs (http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html#M000478) that they should return the same thing. And secondly, why does it return the root, if there was no referrer.