fixes #69: Comment voting non functional

This commit is contained in:
albert
2011-09-14 17:46:42 -04:00
parent fcc6a78fd4
commit 22074eed1f
10 changed files with 73 additions and 31 deletions

View File

@@ -1,15 +1,9 @@
class CommentVotesController < ApplicationController
rescue_from CommentVote::Error, :with => :error
respond_to :js
def create
@comment = Comment.find(params[:comment_id])
@comment.vote!(params[:score])
render :nothing => true
end
private
def error(exception)
@exception = exception
render :action => "error", :status => 500
@comment_vote = @comment.vote!(params[:score])
respond_with(@comment_vote)
end
end