Newbie Question: How can I access the referer

Just wondering if and how I can access the referer from the controller.
Thanks in advance

Give this a try:


That should work,


or in your controller you could use

request_uri – may need to use @request.request_uri

and a whold lot of others

How would I redirect to the referer?

Alexander wrote:

How would I redirect to the referer?

redirect_to :back
Works now. Thanks

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs