diff --git a/app/views/research/journal/volumes/_research_journal_volume.json.jbuilder b/app/views/research/journal/volumes/_research_journal_volume.json.jbuilder deleted file mode 100644 index 535d4a189dec6a53c736e1e45788ae618663d0a9..0000000000000000000000000000000000000000 --- a/app/views/research/journal/volumes/_research_journal_volume.json.jbuilder +++ /dev/null @@ -1,2 +0,0 @@ -json.extract! research_journal_volume, :id, :title, :number, :published_at, :created_at, :updated_at -json.url research_journal_volume_url(research_journal_volume, format: :json) diff --git a/app/views/research/journal/volumes/_volume.html.erb b/app/views/research/journal/volumes/_volume.html.erb index a5211261776535e5ba2b40d8d0391c477d85a50b..dccb276fb27ec63a808aee28d701559c19171c6c 100644 --- a/app/views/research/journal/volumes/_volume.html.erb +++ b/app/views/research/journal/volumes/_volume.html.erb @@ -2,7 +2,7 @@ <div class="card-body"> <h1 class="h4"> <%= link_to volume, - research_journal_volume_path(journal_id: journal, id: volume), + research_journal_volume_path(journal_id: volume.journal, id: volume), class: 'stretched-link' %> </h1> </div> diff --git a/app/views/research/journal/volumes/_volume.json.jbuilder b/app/views/research/journal/volumes/_volume.json.jbuilder new file mode 100644 index 0000000000000000000000000000000000000000..e53ca16927d5ee252fa12e2449da6320f8b71ec0 --- /dev/null +++ b/app/views/research/journal/volumes/_volume.json.jbuilder @@ -0,0 +1,2 @@ +json.extract! volume, :id, :title, :number, :published_at, :created_at, :updated_at +json.url research_journal_volume_url(journal: volume.journal, id: volume, format: :json) diff --git a/app/views/research/journal/volumes/index.html.erb b/app/views/research/journal/volumes/index.html.erb index 7c29510cdff9b8e7fed19c6690ee427a8e8374ba..47fdd67030ccbb54f2ada13919fcad9bfb44bc03 100644 --- a/app/views/research/journal/volumes/index.html.erb +++ b/app/views/research/journal/volumes/index.html.erb @@ -3,7 +3,7 @@ <div class="row"> <% @journal.volumes.each do |volume| %> <div class="col-md-3"> - <%= render volume, journal: @journal %> + <%= render volume %> </div> <% end %> </div> diff --git a/app/views/research/journal/volumes/show.json.jbuilder b/app/views/research/journal/volumes/show.json.jbuilder index 5ce421e45ad574b6a72f67bf63ecaf7beb6684bd..5795a060c4aaddd06972c50c54d30b45200cf1ac 100644 --- a/app/views/research/journal/volumes/show.json.jbuilder +++ b/app/views/research/journal/volumes/show.json.jbuilder @@ -1 +1 @@ -json.partial! "research_journal_volumes/research_journal_volume", research_journal_volume: @research_journal_volume +json.partial! "research/journal/volumes/volume", volume: @volume diff --git a/app/views/research/journals/_journal.json.jbuilder b/app/views/research/journals/_journal.json.jbuilder deleted file mode 100644 index e0145a24de523f3ebe1c3e730ba360a64499b872..0000000000000000000000000000000000000000 --- a/app/views/research/journals/_journal.json.jbuilder +++ /dev/null @@ -1,6 +0,0 @@ -json.extract! journal, :id, :title, :description -json.url research_journal_url(journal, format: :json) -json.volumes journal.volumes do |volume| - json.extract! volume, :id, :title, :published_at - json.url research_journal_volume_url(journal_id: journal, id: volume, format: :json) -end diff --git a/app/views/research/journals/index.html.erb b/app/views/research/journals/index.html.erb index b6ccc1d402277d8d96e21a7a45ea7aec5f7bc0a6..48478c237547ce1aed778c4285565f674bd66697 100644 --- a/app/views/research/journals/index.html.erb +++ b/app/views/research/journals/index.html.erb @@ -10,7 +10,7 @@ <%= link_to 'Lire', journal, class: 'btn btn-primary stretched-link' %> </div> <div class="offset-md-1 col-md-3"> - <%= render journal.volumes.first, journal: journal if journal.volumes.any? %> + <%= render journal.volumes.first if journal.volumes.any? %> </div> </div> <% end %> diff --git a/app/views/research/journals/show.html.erb b/app/views/research/journals/show.html.erb index ec810e91809ecdf45bc51ff521861d7e76b9bc82..2c6f746f43e897f717e209c96a73cb71a5c6287c 100644 --- a/app/views/research/journals/show.html.erb +++ b/app/views/research/journals/show.html.erb @@ -10,7 +10,7 @@ <div class="row"> <% @journal.volumes.each do |volume| %> <div class="col-md-3"> - <%= render volume, journal: @journal %> + <%= render volume %> </div> <% end %> </div> diff --git a/app/views/research/journals/show.json.jbuilder b/app/views/research/journals/show.json.jbuilder index 90c860bf4261e20db4485917d21a6f5e03047606..a43070ca7b563c94c382ea326d7760dfff8ee253 100644 --- a/app/views/research/journals/show.json.jbuilder +++ b/app/views/research/journals/show.json.jbuilder @@ -2,5 +2,5 @@ json.extract! @journal, :id, :title, :description json.url research_journal_url(@journal, format: :json) json.volumes @journal.volumes do |volume| json.extract! volume, :id, :title, :published_at - json.url research_journal_volume_url(journal_id: @journal, id: volume, format: :json) + json.url research_journal_volume_url(journal_id: volume.journal, id: volume, format: :json) end