【发布时间】:2012-04-14 20:23:55
【问题描述】:
我有两个资源控制器,我在其中使用 slug 来表示 ID。 (friendly_id 宝石)。
我可以在路由上显示一个资源的显示路径,但不能同时显示两个。即。
root :to => 'home#index'
match '/:id' => "properties#show"
match '/:id' => "contents#show"
基本上我想要这样的网址,
# Content
domain.com/about-us
domain.com/terms
# Property
domain.com/unique-property-name
domain.com/another-unique-property-name
无论我放在最上面的任何资源都有效。有没有办法做到这一点?
如果您能提供帮助,请提前致谢。
【问题讨论】:
标签: ruby-on-rails-3 ruby-on-rails-3.1