新闻评论出现错误。误将safe_attributes换为直接属性comments

This commit is contained in:
lizanle 2015-04-03 17:06:19 +08:00
parent 5ee732063d
commit 84c2e39e6c
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ class CommentsController < ApplicationController
raise Unauthorized unless @news.commentable?
@comment = Comment.new
@comment.comments = params[:comment]
@comment.safe_attributes = params[:comment]
@comment.author = User.current
if @news.comments << @comment
if params[:asset_id]