【发布时间】:2020-09-07 14:15:07
【问题描述】:
我正在尝试为我的 Rails 路线创建一些别名,例如 'events/8/event_participants/new' 到 /business-meet/registration,
我的路线是这样写的:
resources :events, only: [], shallow: true do
resources :event_participants, only: [:new, :create, :edit, :update] do
post :complete, on: :collection
member do
get :invite, :add_people, :accept_invitation, :invitation_success, :reserved
put :refer
end
end
end
我想要特定事件 id 8 的别名,我尝试使用 redirect,但它实际上重定向到路由,因此整个路由在浏览器中可见,我希望保持可见 /business-meet/registration 路由到我的浏览器。
【问题讨论】:
标签: ruby-on-rails routes nested-routes