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.
 
 
 
 
 

33 lines
684 B

module Api
class JurisprudencesController < BaseController
include JurisprudenceSearch
authorize_resource :jurisprudence, class: "Cdao::Jurisprudence", only: %i[index]
def index
search = jurisprudence_search(search_params)
@jurisprudences = search.results
respond_with @jurisprudences
end
def show
respond_with @jurisprudence
end
def years
authorize! :index, Cdao::Jurisprudence
@years = (1901..Time.zone.today.year).entries.reverse
respond_with @years
end
private
def search_params
params.permit(:reference_number, :title, :short_title, :q, :page, :per_page)
end
end
end