开发者

How to route to a nested resource whilst not routing to the outer parent resource?

开发者 https://www.devze.com 2023-02-11 09:18 出处:网络
Giv开发者_JAVA技巧en the following code: resources :subjects do resources :partipicants end I want to route /subjects/x/partipicants etc

Giv开发者_JAVA技巧en the following code:

resources :subjects do
  resources :partipicants
end

I want to route /subjects/x/partipicants etc

But I do not want to route /subjects etc. (i.e. the regular outer resource).

Anyone know how to pull this off cleanly?

Jack


You can try this:

resources :subjects, :only => [] do
  resources :partipicants
end
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号