I need a referrer path. I do not want a domain name. For example, if the referrer is http://www.google.com/adsense I want /adsense .
http://www.google.com/adsense
/adsense
request.referer returns a string, but you can use the Ruby URI Module to wrap it, and then just ask it along its path:
request.referer
if URI(request.referer).path == '/adsense'
You can access the referrer using
Try this to get a way to abstract your request.
request.env['HTTP_REFERER'].sub(request.base_url, '') => '/adsense'