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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community 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:

$HTTP["referer"]

That should work,,,

Chris
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

http://api.rubyonrails.org/classes/ActionControlle...
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?

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