Skip to content

Commit

Permalink
Use url_for
Browse files Browse the repository at this point in the history
  • Loading branch information
klaustopher committed Jun 19, 2024
1 parent 8724a8a commit f70f7ec
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f70f7ec

Please sign in to comment.