WARNING: Can't verify CSRF token authenticity rails

后端 未结 17 1035
生来不讨喜
生来不讨喜 2020-11-22 06:05

I am sending data from view to controller with AJAXand I got this error:

WARNING: Can\'t verify CSRF token authenticity

I think

17条回答
  •  被撕碎了的回忆
    2020-11-22 06:25

    If you're using javascript with jQuery to generate the token in your form, this works:

    
    

    Obviously, you need to have the <%= csrf_meta_tag %> in your Ruby layout.

提交回复
热议问题