ruby -- 问题解决(二)rails4.0create引起的ActiveModel::ForbiddenAttributesError错误

之前将rails升级到4.0版本,发生了ActiveModel::ForbiddenAttributesError错误
于是上网溜达了一会,找到解决方案,
ActiveModel::ForbiddenAttributesError错误有可能是因为进级到rails 4.0引起的,
此时要将controller表单的提交设置在 @ad=Ad.new(params[:ad])这句之前增加params.permit!这句话。
原文链接:http://www.byywee.com/page/M0/S883/883060.html,楼主一生平安!
posted @ 2013-07-20 16:34  lmei  阅读(384)  评论(0编辑  收藏  举报