rails request.env ["HTTP_REFERER"]在heroku上给出nil

ema*_*han 7 http-referer heroku http-headers ruby-on-rails-3

我在rails应用程序上创建了一个ruby.我有以下情况

在localhost获取引用链接我正在使用request.env["HTTP_REFERER"]它的工作完全不给null.

我已上载在Heroku上的代码,但request.env["HTTP_REFERER"]正在给nil,我在Heroku的日志已经检查.

请提供一个建议,为什么给它nil?有什么方法可以获得推荐人链接request.env["HTTP_REFERER"]吗?

Ale*_*gro 1

request.env["HTTP_REFERER"]直接导航到页面时给出nil是可以接受的,我建议使用link_to :back它或指定它应该返回的位置(link_to root_path)。