Ruby on Rails: 错误“ActionController::InvalidAuthenticityToken when disable JS/Ajax request”解决方案
来源:互联网 发布:国家网络信息安全举报 编辑:程序博客网 时间:2024/05/20 17:39
问题:在RoR项目中提交表格时出现:ActionController::InvalidAuthenticityToken when disable JS/Ajax request 的错误
解决方案:
在<form></form>中添加代码
http://stackoverflow.com/questions/19452853/actioncontrollerinvalidauthenticitytoken-when-disable-js-ajax-request
解决方案:
在<form></form>中添加代码
<%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) %>或,如果是建立的ruby格式的form input:使用:
<%= form_for @some_model, :remote => true, :authenticity_token => true do |f| %><% end %>参考链接:
http://stackoverflow.com/questions/19452853/actioncontrollerinvalidauthenticitytoken-when-disable-js-ajax-request
0 0
- Ruby on Rails: 错误“ActionController::InvalidAuthenticityToken when disable JS/Ajax request”解决方案
- ajax请求错误 ActionController::InvalidAuthenticityToken
- rails firefox ActionController::InvalidAuthenticityToken
- Rails -- ActionController::InvalidAuthenticityToken解决办法
- Ruby on rails 实战圣经:ActionController
- Ruby on rails 实战圣经:ActionController
- ActionController::InvalidAuthenticityToken
- ActionController::InvalidAuthenticityToken in Admin#index 错误解决方法
- "ruby on rails" with "ajax"
- Ruby on Rails 使用 Ajax
- Ruby on Rails错误总结
- post 调用restfull接口 解决出现的ActionController::InvalidAuthenticityToken错误
- ActionController::InvalidAuthenticityToken 解决办法
- ActionController::InvalidAuthenticityToken解决办法
- ActionController::InvalidAuthenticityToken解决途径
- ActionController::InvalidAuthenticityToken解决办法
- Ruby on Rails 错误“Rails 4.0.0, Gemfile requires rake 10.1.0 for Rake” 解决方案
- Ruby on Rails 中应用Ajax
- The type HttpExchange is not accessible due to restriction on required library 错误
- HttpServletRequest request ServletRequestUtils
- 搭建高可用mongodb集群(四)—— 分片
- 关于名空间的使用小结
- Qt编程中,Ui文件如何被利用...
- Ruby on Rails: 错误“ActionController::InvalidAuthenticityToken when disable JS/Ajax request”解决方案
- hadoop 学习笔记
- 回忆录之初试三顾冒菜道
- 常量指针 和 指针常量
- 图灵奖得主(五)
- 如花美眷,似水流年
- 大方的说法是的奋斗的大幅度
- 关于OpenSSL“心脏出血”漏洞的分析
- Java连接MYSQL 数据库