私のルート:
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
これを行うためのよりエレガントな方法はありますか?そう思わない場合は、どちらがあなたの意見で最高かを教えてください。