更新时间:2023-11-30 14:52:16
resources :posts
resources :categories do |categories|
categories.resources :posts
end
您的网址,然后:
/帖子
-所有帖子
/ posts /:id
-某些帖子
/类别
-所有类别
/ categories /:id
-某些类别
/ categories /:id / posts
-某个类别中的所有帖子。
/categories/:id/posts
- all posts within a certain category.