From f70f7ec304484a2801327bca47130b05a8817847 Mon Sep 17 00:00:00 2001 From: Klaus Zanders Date: Wed, 19 Jun 2024 08:13:38 +0200 Subject: [PATCH] Use url_for --- .../work_packages/share/permission_button_component.rb | 2 +- app/components/work_packages/share/share_row_component.html.erb | 2 +- config/routes.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/components/work_packages/share/permission_button_component.rb b/app/components/work_packages/share/permission_button_component.rb index 44421df9d951..07c8f242f8e1 100644 --- a/app/components/work_packages/share/permission_button_component.rb +++ b/app/components/work_packages/share/permission_button_component.rb @@ -45,7 +45,7 @@ def initialize(share:, **system_arguments) # or be passive and work like a select inside a form. def update_path if share.persisted? - work_package_share_path(share.entity, share) + url_for([share.entity, share]) end end diff --git a/app/components/work_packages/share/share_row_component.html.erb b/app/components/work_packages/share/share_row_component.html.erb index 445c2ca8661c..8f2236e00b6d 100644 --- a/app/components/work_packages/share/share_row_component.html.erb +++ b/app/components/work_packages/share/share_row_component.html.erb @@ -27,7 +27,7 @@ end user_row_grid.with_area(:remove, tag: :div) do - form_with url: work_package_share_path(work_package, share), method: :delete do + form_with url: url_for([work_package], share), method: :delete do render(Primer::Beta::IconButton.new(icon: "trash", type: :submit, scheme: :danger, diff --git a/config/routes.rb b/config/routes.rb index b5626b227e3b..8c273c0506c0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -530,7 +530,7 @@ get "details/*state" => "work_packages#index", on: :collection, as: :details # Rails managed sharing route - resources :shares, controller: "work_packages/shares", only: %i[index create update destroy] do + resources :members, path: :shares, controller: "work_packages/shares", only: %i[index create update destroy] do member do post "resend_invite" => "work_packages/shares#resend_invite" end