Skip to content

Commit d3e6221

Browse files
committed
CommentsController#post_unfollow should respond to JSON requests
1 parent 69ffb2d commit d3e6221

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/controllers/comments_controller.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,11 @@ def post_follow
288288
def post_unfollow
289289
@post = Post.find(params[:post_id])
290290
ThreadFollower.where(post: @post, user: current_user).destroy_all
291-
redirect_to post_path(@post)
291+
292+
respond_to do |format|
293+
format.html { redirect_to post_path(@post) }
294+
format.json { render json: { status: 'success' } }
295+
end
292296
end
293297

294298
def pingable

0 commit comments

Comments
 (0)