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?

    评论

报告相同问题?

悬赏问题

  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。