Rails中引用的来源

时间:2015-01-26 10:20:12

标签: ruby-on-rails

request.referre或request.env ['HTTP_REFERER']给我当前的网址,但我想获取我的活动发布的Facebook / linkedin网址。请帮帮我,我是rails的新手

if @request=request.env['HTTP_REFERER']
  # request.env['HTTP_REFERER'].include?('facebook')
      ExternalRefer.create(:name =>request.env['HTTP_REFERER'], :ip => client_ip.to_s )
end 

0 个答案:

没有答案