I'm migrating an application from Rails 2 to Rails 3.
We have multiple namespaced controllers with different namespaces.
As they are not RESTfull I don't want to use resource routing, instead I would like to have an old Rails 2 like match ':controller/:action' that picks up namespaced controllers.
In my routes.rb I have
# Install the default route as the lowest priority.
match ':controller(/:action(/:id(.:format)))'
match ':controller(/:action(/:id(.:format)))', :controller => /[^\/]+\/[^\/]+/
rake routes reports
/:controller(/:action(/:id(.:format))) :controller#:action
/:controller(/:action(/:id(.:format))) (?-mix:[^\/]+\/[^\/]+)#:action
Still a request to /config/companies/index fails
ActionController::RoutingError (No route matches [GET] "/config/companies/index"):
What am I doing wrong? Is there another way to get namespaced routes with dynamic segments? When I try to use namespace and a match with a dynamic segment together it throws an error.
:controller segment is not allowed within a namespace block