Forum: Ruby on Rails Newbie Question: How can I access the referer

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Alexander (Guest)
on 2006-03-24 11:07
Just wondering if and how I can access the referer from the controller.
Thanks in advance
Chris Korhonen (Guest)
on 2006-03-24 11:13
(Received via mailing list)
Give this a try:


That should work,,,

Daniel -. (Guest)
on 2006-03-24 11:28
(Received via mailing list)
or in your controller you could use

request_uri  -- may need to use @request.request_uri

and a whold lot of others
Alexander (Guest)
on 2006-03-24 11:40
How would I redirect to the referer?
Alexander (Guest)
on 2006-03-24 11:41
Alexander wrote:
> How would I redirect to the referer?

redirect_to :back
Works now. Thanks
This topic is locked and can not be replied to.