class DocumentsController < ApplicationController include JurisprudenceSearch load_and_authorize_resource :document, class: "Cdao::Jurisprudence" def index @search_params = search_params search = jurisprudence_search(@search_params) @jurisprudences = search.results respond_to do |format| format.html end end def show @subjects = Cdao::Subject.all @doctrines = @document.doctrines where = { enabled: true, state: "published" } @cited_in_documents = @document.class.citing_docs_of(@document, where) @paginated_cited_in_documents = Kaminari.paginate_array(@cited_in_documents, total_count: @cited_in_documents.count).page(params[:page]).per(20) # @cross_ref_documents = @document.class.cited_docs_of(document, where) end def search index respond_to do |format| format.html { render :search } end end private def search_params params.permit(:reference_number, :title, :short_title, :ponente, :year_start, :year_end, :citation_finder, :subject_ids, :q, :page, :per_page) end end