comment votes: add index page.
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
class CommentVotesController < ApplicationController
|
||||
respond_to :js, :json, :xml
|
||||
before_action :member_only
|
||||
skip_before_action :api_check
|
||||
respond_to :js, :json, :xml, :html
|
||||
rescue_with CommentVote::Error, ActiveRecord::RecordInvalid, status: 422
|
||||
|
||||
def index
|
||||
@comment_votes = CommentVote.includes(:user, comment: [:creator, :post]).paginated_search(params)
|
||||
respond_with(@comment_votes)
|
||||
end
|
||||
|
||||
def create
|
||||
@comment = Comment.find(params[:comment_id])
|
||||
@comment_vote = @comment.vote!(params[:score])
|
||||
|
||||
Reference in New Issue
Block a user