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.
40 lines
986 B
40 lines
986 B
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) |
|
# @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, :syllabus, |
|
:year_start, :year_end, :citation_finder, :subject_ids, |
|
:q, :page, :per_page) |
|
end |
|
end
|
|
|