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.
Baf018e2cc4616e4776d323215c7136c?d=identicon&s=25 Alexander (Guest)
on 2006-03-24 10:07
Just wondering if and how I can access the referer from the controller.
Thanks in advance
5a64b64d7a2c7347be1a42a5bbb03360?d=identicon&s=25 Chris Korhonen (Guest)
on 2006-03-24 10:13
(Received via mailing list)
Give this a try:

$HTTP["referer"]

That should work,,,

Chris
9d1f5d2d9de70bd9a934f557dc95a406?d=identicon&s=25 Daniel ----- (liquid)
on 2006-03-24 10: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...
Baf018e2cc4616e4776d323215c7136c?d=identicon&s=25 Alexander (Guest)
on 2006-03-24 10:40
How would I redirect to the referer?
Baf018e2cc4616e4776d323215c7136c?d=identicon&s=25 Alexander (Guest)
on 2006-03-24 10: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.