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