我有一個名爲Product
的模型,它有一個名爲category
的字段。 如何使用category
字段爲Product
模型製作嵌套的資源路由?
如:
列上的Rails嵌套資源路由
/category1/ --> index products with 'category = category1'
/category2/13 --> show product '13' with 'category = category2'
/categories/ --> show overview of categories
我希望我的問題質量不錯;新的在stackoverflow – raj1v