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

dev_repository_hjq
lizanle 10 years ago
parent 5ee732063d
commit 84c2e39e6c

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

Loading…
Cancel
Save