From efa0cf16d92d1fec920b040f92eb306df023cbf3 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 16 Aug 2015 23:04:26 +0200 Subject: [PATCH] uses comment strong parameters --- app/controllers/comments_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 6c2df3be6..71de112a9 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -24,11 +24,11 @@ class CommentsController < ApplicationController private def comment_params - params.require(:comments).permit(:commentable_type, :commentable_id, :body) + params.require(:comment).permit(:commentable_type, :commentable_id, :body) end def build_comment - @comment = Comment.build(debate, current_user, params[:comment][:body]) + @comment = Comment.build(debate, current_user, comment_params[:body]) end def debate @@ -36,7 +36,7 @@ class CommentsController < ApplicationController end def parent - @parent ||= Comment.find_parent(params[:comment]) + @parent ||= Comment.find_parent(comment_params) end def reply?