Added some json support

This commit is contained in:
MrYummy
2017-06-21 01:59:02 +02:00
parent 992406a20b
commit 0972181e75
3 changed files with 25 additions and 5 deletions

View File

@@ -2,6 +2,12 @@ class CommentsController < ApplicationController
include MailerHelper
def show
respond_to do |format|
format.json {render json: @comment.attributes.to_json}
end
end
def edit
@comment = Comment.find(params[:id])
if mod? || @comment.author.is?(current_user)
@@ -72,4 +78,4 @@ class CommentsController < ApplicationController
def comment_params
params.require(:comment).permit(:content)
end
end
end