weixin_33728268 2016-10-04 16:59 采纳率: 0%
浏览 24

Ror-检查URL是否为AJAX

I'm trying to blacklist URL's that are AJAX for a login redirect. I have the following code:

request.fullpath =~ /\A\/(login|sso_login|sign_out|auth)/

How can I use xhr? to request the fullpath only if the URL is not xhr?

  • 写回答

1条回答 默认 最新

  • weixin_33713503 2016-10-04 18:01
    关注

    Add a guard to whatever this code does with unless request.xhr?

    评论

报告相同问题?