diff options
Diffstat (limited to 'guides/code/getting_started/app/controllers/comments_controller.rb')
-rw-r--r-- | guides/code/getting_started/app/controllers/comments_controller.rb | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/guides/code/getting_started/app/controllers/comments_controller.rb b/guides/code/getting_started/app/controllers/comments_controller.rb deleted file mode 100644 index 61813b1003..0000000000 --- a/guides/code/getting_started/app/controllers/comments_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class CommentsController < ApplicationController - - http_basic_authenticate_with name: "dhh", password: "secret", only: :destroy - - def create - @article = Article.find(params[:article_id]) - @comment = @article.comments.create(comment_params) - redirect_to article_path(@article) - end - - def destroy - @article = Article.find(params[:article_id]) - @comment = @article.comments.find(params[:id]) - @comment.destroy - redirect_to article_path(@article) - end - - private - - def comment_params - params.require(:comment).permit(:commenter, :body) - end -end |