我有一个名为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