Added more json support

This commit is contained in:
MrYummy
2017-07-01 04:44:00 +02:00
parent 0972181e75
commit 361b15e398
4 changed files with 41 additions and 6 deletions

View File

@@ -7,7 +7,12 @@ class ForumthreadsController < ApplicationController
end
def show
@replies = @thread.replies.page(params[:page])
if @thread
@replies = @thread.replies.page(params[:page])
else
respond_to {|format| format.json {render json: Comment.find_by(id: params[:id][1..-1]).try(:attributes).to_json}}
end
end
def edit
@@ -92,4 +97,4 @@ class ForumthreadsController < ApplicationController
a += add
params.require(:forumthread).permit(a)
end
end
end