user12882
user12882

Reputation: 4792

How to retrieve the value of the URL from where a request is performed?

I am using Ruby on Rails (3.2.2) and I would like to retrieve the value of the URL from where a request is performed. That is, given I am on the http://stackoverflow.com/questions/10147789 Web page and in that page content there is an link having a URL to my application at http://my_application.com, when I access that URL I would like to retrieve the http://stackoverflow.com/questions/10147789 string.

Is it possible? If so, how?

Upvotes: 1

Views: 83

Answers (1)

Vasiliy Ermolovich
Vasiliy Ermolovich

Reputation: 24617

Yes, it is. You can use HTTP_REFERER

request.referer

Upvotes: 2

Related Questions