fixes #2700: Unvote Missing Template Exception

This commit is contained in:
r888888888
2016-10-04 14:42:48 -07:00
parent 1d0af0358f
commit ebff27c7c0
6 changed files with 36 additions and 0 deletions

View File

@@ -7,4 +7,11 @@ class CommentVotesController < ApplicationController
@comment_vote = @comment.vote!(params[:score])
respond_with(@comment_vote)
end
def destroy
@comment = Comment.find(params[:comment_id])
@comment.unvote!(params[:score])
rescue CommentVote::Error => x
@error = x
end
end