您的位置:首页 > 编程语言 > Python开发

【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。问题解决,顺便记下来备忘。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: