# total hack, but it actually seems to generate the right routes. Definitely something I'd want to see pushed into the core. ActionController::Routing::Routes.draw do |map| map.edit_community "/communities/:community_permalink-:id/edit", :controller => "communities", :action => 'edit' map.community "/communties/:community_permalink-:id", {:action=>"show", :controller=>"communities"} map.edit_forum "/forums/:forum_permalink-:id/edit", :controller => "forums", :action => 'edit' map.forum "/forums/:forum_permalink-:id", {:action=>"show", :controller=>"forum"} map.edit_post "/posts/:forum_permalink-:id/edit", :controller => "posts", :action => 'edit' map.post "/posts/:post_permalink-:id", {:action=>"show", :controller=>"posts"} map.resources :communities, :shallow => true do |community| community.resources :forums, :path_prefix => "/communities/:community_permalink-:community_id" do |forum| forum.resources :topics, :controller => :posts, :path_prefix => "/forums/:forum_permalink-:forum_id" do |topic| topic.resources :posts, :path_prefix => "/topics/:topic_permalink-:topic_id" end end end end