Forum: Ruby on Rails 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.
Jens K. (Guest)
on 2006-01-17 13:52
Hello forum,

i currently try to learn ruby on rails. my first little project will be
a link blog.

i try to get the referer variable - but i don't know to get it.

def index
 @url = request.env["?"]
 render :text => "The domain from which you come from is #{@url}"
end

Or do I should use the Net::HTTP?

-jens
mikkel (Guest)
on 2006-01-17 13:55
request.env['HTTP_REFERER']

Mikkel

Jens K. wrote:
> Hello forum,
>
> i currently try to learn ruby on rails. my first little project will be
> a link blog.
>
> i try to get the referer variable - but i don't know to get it.
>
> def index
>  @url = request.env["?"]
>  render :text => "The domain from which you come from is #{@url}"
> end
>
> Or do I should use the Net::HTTP?
>
> -jens
This topic is locked and can not be replied to.