Files
danbooru/app/controllers/post_disapprovals_controller.rb
2020-03-20 18:03:01 -05:00

18 lines
549 B
Ruby

class PostDisapprovalsController < ApplicationController
skip_before_action :api_check
respond_to :js, :html, :json, :xml
def create
@post_disapproval = authorize PostDisapproval.new(user: CurrentUser.user, **permitted_attributes(PostDisapproval))
@post_disapproval.save
respond_with(@post_disapproval)
end
def index
@post_disapprovals = authorize PostDisapproval.paginated_search(params)
@post_disapprovals = @post_disapprovals.includes(:user) if request.format.html?
respond_with(@post_disapprovals)
end
end