Added some json support
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user