jqgrid中发送参数困难

Difficulty in send parameters in jqgrid

我必须使用 jqgrid 编辑 url 发送真实性令牌。问题是 url 和参数有不同的值。

已开始 POST

"/users-jqedit/?authenticity_token=hSn3r02sT3w15HY+dNjpYvUuXxWclpXz
RKJnfMBJSkQ="

但是参数是

Parameters:{"authenticity_token"=>
"hSn3r02sT3w15HY dNjpYvUuXxWclpXzRKJnfMBJSkQ="}

导致无法验证 CSRF 令牌真实性错误。

有线索吗?这是代码

$(function () {
 $("#list").jqGrid({
       url:'/users-jq', 
       editurl:"/users-jqedit/?authenticity_token=<%=form_authenticity_token.to_s%>",

如果我正确理解你的问题,那么你需要使用

editurl: "/users-jqedit/?authenticity_token=" +
    encodeURIComponent("<%=form_authenticity_token.to_s%>"),

而不是

editurl:"/users-jqedit/?authenticity_token=<%=form_authenticity_token.to_s%>",