You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
606 B
29 lines
606 B
|
|
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 |
|
|