diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 39e0490..fe95fd5 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -52,6 +52,7 @@ class CommentsController < ApplicationController if @comment format.html { redirect_to @comment.commentable, notice: 'Comment was successfully created.', show_comments: true } format.json { render json: @comment, status: :created, location: @comment } + else format.html { render action: "new" } format.json { render json: @comment.errors, status: :unprocessable_entity }