【发布时间】:2017-06-15 16:52:56
【问题描述】:
我有一个名为Product 的模型,它有一个名为category 的字段。
如何使用 category 字段为 Product 模型创建嵌套资源路由?
例如:
/category1/ --> index products with 'category = category1'
/category2/13 --> show product '13' with 'category = category2'
/categories/ --> show overview of categories
【问题讨论】:
-
我希望我的问题质量不错; stackoverflow 上的新功能
标签: ruby-on-rails ruby routing