Newbie Question: How can I access the referer


#1

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


#2

Give this a try:

$HTTP[“referer”]

That should work,

Chris


#3

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/ActionController/AbstractRequest.html#M000153


#4

How would I redirect to the referer?


#5

Alexander wrote:

How would I redirect to the referer?

Sorry,
redirect_to :back
Works now. Thanks