4

私のルート:

resources :events, :path_names => { :new => "organize" } do
    resources :forums
end

これらのルートでは、のようなURLを取得します/events/:event_id/forums/organize。path_namesをネストされたルートに伝播させたくありません...path_namesそれらを再定義する必要がありますか?または使用しscopeますか?

resources :events, :path_names => { :new => "organize" } do
    scope :path_names => { :new => "new" } do
        resources :forums
        # other nested resources...
    end
end

または(より良い解決策が見つかるまで、私のお気に入り;))

resources :events, :path_names => { :new => "organize" }
resources :events, :only => [] do
    #nested resources...
end

これを行うためのよりエレガントな方法はありますか?そう思わない場合は、どちらがあなたの意見で最高かを教えてください。

4

1 に答える 1

0

私は最後のオプションに行きました:

resources :events, :path_names => { :new => "organize" }
resources :events, :only => [] do
    #nested resources...
end
于 2012-01-21T15:17:49.773 に答える