diff --git a/app/components/samples/table_component.html.erb b/app/components/samples/table_component.html.erb index e021f32e7b..0a180bf67c 100644 --- a/app/components/samples/table_component.html.erb +++ b/app/components/samples/table_component.html.erb @@ -101,7 +101,7 @@ <% end %> <% if column == :puid || column == :name %> <%= link_to( - project_sample_path(sample.project, sample), + namespace_project_sample_path(sample.project.namespace.parent, sample.project, sample), data: { turbo: false }, class: "text-slate-700 dark:text-slate-300 font-semibold hover:underline" ) do %> @@ -116,7 +116,7 @@ <% end %> <% elsif column == :project_id %> <%= link_to sample.project.puid, - project_samples_path(sample.project), + namespace_project_samples_path(sample.project.namespace.parent, sample.project), data: { turbo: false, }, diff --git a/app/controllers/groups/samples_controller.rb b/app/controllers/groups/samples_controller.rb index 5246c4a098..289eb5561e 100644 --- a/app/controllers/groups/samples_controller.rb +++ b/app/controllers/groups/samples_controller.rb @@ -25,7 +25,7 @@ def index end )), order: sort, - includes: [:project]) + includes: [project: { namespace: [{ parent: :route }, :route] }]) @pagy, @samples = pagy_searchkick(collection, limit: params[:limit] || 20) @has_samples = true end diff --git a/app/controllers/projects/samples_controller.rb b/app/controllers/projects/samples_controller.rb index ebc03a5ce5..a0e7e8ec91 100644 --- a/app/controllers/projects/samples_controller.rb +++ b/app/controllers/projects/samples_controller.rb @@ -27,7 +27,7 @@ def index end )), order: sort, - includes: [:project]) + includes: [project: { namespace: [{ parent: :route }, :route] }]) @pagy, @samples = pagy_searchkick(collection, limit: params[:limit] || 20) @has_samples = @project.samples.size.positive? end