Rails 3 get request referrer

前端 未结 2 1462
长情又很酷
长情又很酷 2020-12-16 10:11

I\'m using Rails 3.0.9, Ruby 1.9.2, Devise 1.3.4 and has a need in Devise session new view to access the request url parameters although I see this as a general Rails reques

相关标签:
2条回答
  • 2020-12-16 10:51

    You can use request.referer or request.env['HTTP_REFERER'] in your controller to get the referer url.

    0 讨论(0)
  • 2020-12-16 10:54

    I have just found out that WEBrick handles request.referrer incorrectly. But don't worry. Unicorn handles it right. I did't test that on other servers. You should check this with yours. I don't think that you use WEBrick as a production server.

    0 讨论(0)
提交回复
热议问题