【python】讨论input 和raw_input 的区别
2014-07-15 16:27
435 查看
ActionController::InvalidAuthenticityToken解决方法
Rails支持将session放在数据库中管理,当我执行完rake命令,去掉environment.rb里的config.action_controller.session_store这个注释,Rails2.0以上的版本会报一个错,具体如下:
ActionController::InvalidAuthenticityToken in Products#index
Showing products/index.html.erb where line #17 raised:
No :secret given to the #protect_from_forgery call. Set that or use a session store capable of generating its own keys (Cookie Session Store).
于是上网搜搜,解决方法是到这个文件app/controllers/application.rb,看到这样的描述:
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
protect_from_forgery #:secret => 'be73f1c53c4d8c3b373da4ebfb6599a2'
于是,把#:secret => 'be73f1c53c4d8c3b373da4ebfb6599a2'前的#去掉,再刷新页面,OK。问题解决,顺便记下来备忘。
Rails支持将session放在数据库中管理,当我执行完rake命令,去掉environment.rb里的config.action_controller.session_store这个注释,Rails2.0以上的版本会报一个错,具体如下:
ActionController::InvalidAuthenticityToken in Products#index
Showing products/index.html.erb where line #17 raised:
No :secret given to the #protect_from_forgery call. Set that or use a session store capable of generating its own keys (Cookie Session Store).
于是上网搜搜,解决方法是到这个文件app/controllers/application.rb,看到这样的描述:
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
protect_from_forgery #:secret => 'be73f1c53c4d8c3b373da4ebfb6599a2'
于是,把#:secret => 'be73f1c53c4d8c3b373da4ebfb6599a2'前的#去掉,再刷新页面,OK。问题解决,顺便记下来备忘。
相关文章推荐
- Python 之 raw_input()与input()区别
- Python中的input方法与raw_input方法区别小记
- Python raw_input和input总结 在版本2和版本3中的区别
- Python菜鸟晋级04----raw_input() 与 input()的区别
- Python raw_input和input总结 在版本2和版本3中的区别
- python屏幕的交互(读取输出信息)input,raw_input的区别
- python input 与raw_input函数的区别
- python中raw_input 和 input的区别
- python input 与raw_input函数的区别
- Python中input()函数与raw_input()函数的区别
- python 中 input 和 raw_input 的区别
- Python 中 input()用法 以及与raw_input() 的区别
- python中input()和raw_input()的区别
- python中input和raw_input用法及区别
- Python raw_input和input总结 在版本2和版本3中的区别
- Python input和raw_input的区别
- 【Python】Python input和raw_input的区别
- Python中input和raw_input的区别
- Python中input和raw_input的一点区别
- python input函数和raw_input函数的区别