diff --git a/app/controllers/doctrines_controller.rb b/app/controllers/doctrines_controller.rb index 5d8a2fa..1c47891 100644 --- a/app/controllers/doctrines_controller.rb +++ b/app/controllers/doctrines_controller.rb @@ -25,7 +25,7 @@ class DoctrinesController < ApplicationController def show @jurisprudence = @doctrine.doctrine_jurisprudences.present? ? @doctrine.doctrine_jurisprudences.first.jurisprudence : nil - search = annotation_search(params.permit(:page, :per_page)) + search = annotation_search({ doctrine_id: @doctrine.id }) @annotations = search.results end diff --git a/app/controllers/document/doctrines_controller.rb b/app/controllers/document/doctrines_controller.rb index 14f4349..0b767a3 100644 --- a/app/controllers/document/doctrines_controller.rb +++ b/app/controllers/document/doctrines_controller.rb @@ -6,7 +6,7 @@ class Document::DoctrinesController < ApplicationController def show - search = annotation_search(params.permit(:page, :per_page)) + search = annotation_search({ doctrine_id: @doctrine.id }) @annotations = search.results end end diff --git a/app/javascript/controllers/annotations_controller.js b/app/javascript/controllers/annotations_controller.js index 7663531..50a2119 100644 --- a/app/javascript/controllers/annotations_controller.js +++ b/app/javascript/controllers/annotations_controller.js @@ -110,6 +110,6 @@ export default class extends ApplicationController { } paginate () { - this.stimulate("AnnotationReflex#render_annotations_views", { page: this.element.dataset["page"] }) + this.stimulate("AnnotationReflex#render_annotations_views", { doctrine_id: this.element.dataset["doctrineId"], page: this.element.dataset["page"] }) } } diff --git a/app/reflexes/annotation_reflex.rb b/app/reflexes/annotation_reflex.rb index 88b5386..dfff1c0 100644 --- a/app/reflexes/annotation_reflex.rb +++ b/app/reflexes/annotation_reflex.rb @@ -14,6 +14,7 @@ class AnnotationReflex < ApplicationReflex def render_annotations_views(search_params) search = annotation_search(search_params) @annotations = search.results - morph "#annotationsIndexView", render(partial: "/shared/annotations_index_view", locals: { annotations: @annotations, opts: { current_page: search_params[:page] } }) + morph "#annotationsIndexView", render(partial: "/shared/annotations_index_view", locals: { annotations: @annotations, + opts: { doctrine_id: search_params[:doctrine_id], current_page: search_params[:page] } }) end end