Files
danbooru/app/controllers/comment_votes_controller.rb
2011-04-01 19:01:17 -04:00

16 lines
354 B
Ruby

class CommentVotesController < ApplicationController
rescue_from CommentVote::Error, :with => :error
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
end
end