我有很多资源需要在销毁记录之前拥有删除视图,例如:
resources :assignments do
get 'delete'
end
resources :occupations do
get 'delete'
end
resources :extra_shifts do
get 'delete'
end
resources :events do
get 'delete'
end
有没有办法可以干这个?
我知道Routing Concerns,但是这样我只需将路线移到街区外,并将其设置在资源线旁边,这可以节省一些线路,但仍然有很多重复。
答案 0 :(得分:0)
非常确定
resources :assignments, :events,
:occupations, :extra_shifts do
get 'delete'
end
会起作用