Rails -- ActionController::InvalidAuthenticityToken解决办法
2015-11-11 14:27
519 查看
原文链接:http://cnkerry.iteye.com/blog/350718
解决方法一:
解决方法二:
修改config/environment/development.rb(或者production.rb)
然后重启服务器
解决方法三:
在jquery或者form中加入
解决方法一:
class FooController < ApplicationController protect_from_forgery :except => :index # you can disable csrf protection on controller-by-controller basis: skip_before_filter :verify_authenticity_token end
解决方法二:
修改config/environment/development.rb(或者production.rb)
# Disable request forgery protection in development environment config.action_controller.allow_forgery_protection = false
然后重启服务器
解决方法三:
在jquery或者form中加入
<%= tag(:input, :type => "hidden", :name => request_forgery_protection_token.to_s, :value => form_authenticity_token) %>
相关文章推荐
- pyhton基础之aiohttp
- Rails -- 中文字符串截取的函数
- Rails--自动清除开发日志
- Mplayer 1.2 源码分析--main函数
- golang中container/ring包用法
- Timus Online Judge 1651 Shortest Subchain
- No Brainer
- U3D 平行光阴影细节 Directional Shadow Details
- golang中container/heap包用法
- HDU 2389 ——Rain on your Parade——————【Hopcroft-Karp求最大匹配、sqrt(n)*e复杂度】
- main()函数常用的格式:main(int argc,char **argv)
- Active UNIX domain Sockets--------由netstat想到的
- Foxmail 绑定企业邮箱
- LeetCode -- Container With Most Water
- 简单几步,在heroku中部署你的rails项目
- sleep join yield | wait notify notifyAll
- 访百度糯米之 Caused by: libcore.io.ErrnoException: open failed: EACCES (P
- tail /grep/more
- 解决Visual Studio 2015创建工程时的“DNX SDK version 'dnx-clr-win-x86.1.0.0-beta5' failed to install.”错误
- 【已解决】Activity MainActivity has leaked window PhoneWindow$DecorView@ that was originally added here