diff --git a/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb b/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb index cff8648..676ab1a 100644 --- a/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb +++ b/app/components/doctrine_index_table_component/doctrine_index_table_component.html.erb @@ -7,7 +7,7 @@ <% search_results.each do |search_result| %> - + <%= document_reference_number(search_result.document) %> <%= document_title(search_result.document) %> <%= date_or_year(search_result.document) %> diff --git a/app/components/document_doctrine_index_component.rb b/app/components/document_doctrine_index_component.rb index 2e182ac..e62e32c 100644 --- a/app/components/document_doctrine_index_component.rb +++ b/app/components/document_doctrine_index_component.rb @@ -10,14 +10,9 @@ class DocumentDoctrineIndexComponent < BaseComponent delegate :id, to: :doctrine delegate :subject_ids, to: :doctrine delegate :content, to: :doctrine - delegate :document_id, to: :doctrine delegate :annotations, to: :doctrine delegate :subjects, to: :doctrine - def doctrine_form_url - jurisprudence_doctrines_path(jurisprudence_id: document_id) - end - def annotation_form_url doctrine_annotations_path(doctrine_id: id) end diff --git a/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb index 045420a..1e90379 100644 --- a/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb +++ b/app/components/document_doctrine_index_component/document_doctrine_index_component.html.erb @@ -1,4 +1,4 @@ -
- <%= render(DocumentDoctrineIndexComponent.with_collection(@doctrines, current_user: current_user)) %> + <%= render(DocumentDoctrineIndexComponent.with_collection(@doctrines, current_user: current_user, opts: { document_id: @document.id })) %>
diff --git a/config/routes.rb b/config/routes.rb index 6d08589..0ecb35b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ Rails.application.routes.draw do root to: "home#index" - resources :doctrines, only: %i[index] do + resources :doctrines, only: %i[index show] do get :search, on: :collection scope module: :doctrine do resources :annotations, only: %i[create update destroy] @@ -26,7 +26,7 @@ Rails.application.routes.draw do end namespace :api, defaults: { format: :json } do - resources :doctrines, only: %i[index show] do + resources :doctrines do scope module: :doctrine do resources :annotations end