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
628 B

class DoctrinesController < ApplicationController
load_and_authorize_resource :doctrine, class: "Doctrine"
def index
@search = search_doctrines(search_params)
@doctrines = @search.results
respond_to do |format|
format.html
end
end
def show; end
private
def search_doctrines(args)
Doctrine.search do
if args[:subject_ids].present?
with(:subject_ids).any_of(args[:subject_ids].map(&:to_i))
end
paginate page: args[:page] || 1, per_page: args[:per_page] || 100
end
end
def search_params
params.permit(subject_ids: [])
end
end