Rails, Devise authentication, CSRF issue

前端 未结 10 1129
不思量自难忘°
不思量自难忘° 2020-11-28 20:52

I\'m doing a singe-page application using Rails. When signing in and out Devise controllers are invoked using ajax. The problem I\'m getting is that when I 1) sign in 2) sig

10条回答
  •  遥遥无期
    2020-11-28 21:35

    Check whether you have included this in your application.js file

    //= require jquery

    //= require jquery_ujs

    The reason being is jquery-rails gem which automatically sets the CSRF token on all Ajax requests by default, needs those two

提交回复
热议问题