rewrite comments form, use strong parameters with comments

This commit is contained in:
Stella Rouzi 2016-03-20 19:06:12 +02:00
parent 3ad009658d
commit 3f882957cf
3 changed files with 10 additions and 7 deletions

View file

@ -94,7 +94,9 @@ module Admin
end
def comment
comment = Comment.build_from(@event, current_user.id, comment_params)
comment = Comment.new(comment_params)
comment.commentable = @event
comment.user_id = current_user.id
comment.save!
if !params[:parent].nil?
comment.move_to_child_of(params[:parent])