摘要: 用户登录章节,书上的代码会报错,Can’t mass-assign protected attributes: password_confirmation。解决办法:在rails3.2中,自动生成脚手架的话,app/models/user.rb中有这么一行1 attr_accessible :name, :hashed_password,:salt需在后面加上:password_confirmation和:password两项属性。即attr_accessible :name, :password_confirmation,:password,:hashed_password,:salt参.. 阅读全文
posted @ 2013-04-07 12:14 CowboyRyan 阅读(150) 评论(0) 推荐(0) 编辑