0

如果我像下面这样设置路由,它会自动创建路径,例如 community_community_topicnew_community_community_topicedit_community_community_topic

resources :communities, :path => "community" do
    resources :community_topics, :path => "topic"
end

如果我想要这样的路径
community_topic而不是community_community_topics

如何编码我的 routes.rb?

4

1 回答 1

1

你试过用:as吗?请参阅有关路由的 Railsguides

resources :magazines do
  resources :ads, :as => 'periodical_ads'
end
于 2012-12-22T08:49:06.717 回答