Referer

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

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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs