简体   繁体   中英

Rails: request.referrer == request.url

Perhaps I misunderstand how request.referrer works, but isn't it suppose to provide you with the url of the page the user is coming from? So for instance, if they're viewing an article and then click edit, their request might look like this:

request.referrer = http://localhost:3000/article/1
request.url = http://localhost:3000/article/1/edit

If that's the case, then I'm getting odd behaviour, because the user's request.referrer is always set to the current url. What might be causing this? It's worth noting that I'm using an AJAX powered site, and all these requests are remote.

request.referrer应该是您发出请求的URL,如果您使用的是AJAX,我认为您应该更改URL,以便您的引荐来源更改。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM