module Api class DoctrinesController < BaseController include DoctrineSearch load_and_authorize_resource :doctrine, class: "Doctrine", only: %i[show] authorize_resource :doctrine, class: "Doctrine", only: %i[index] def index search = doctrine_search(search_params) @doctrines = search.results respond_with @doctrines end def show respond_with @doctrine end private def search_params params.permit(:created_at, :q, :page, :per_page, exclude_ids: [], subject_ids: [], user_ids: []) end end end