且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Rails的身份验证令牌和Ajax

更新时间:2023-12-01 09:34:34

解决了!改变了阿贾克斯

Solved! changed the ajax to

data: "=" + action + "&ids=" + ids + "&authenticity_token=" + AUTH_TOKEN,

和我添加到头部的每一页

And I added to the head for each page

<%= javascript_tag "const AUTH_TOKEN = #{form_authenticity_token.inspect};" if protect_against_forgery? %>