I need to create a default route for my application:
match '/:controller(/:action(/:id))'
The thing is that my controllers are located in different folders, like this:
/myapp/app/controller/admin/base_controller.rb
However, Rails doesn’t seem to recognize these controllers with my default route, it does recognize a controller if it is in ‘myapp/app/controller/some_controller.rb’ though.
I think that you need to add a namespace for each of your directories, containing the default route within:
You could probably do it programmatically by inspecting your directory structure, using the Dir and File classes. In either case, I’d advise against using default routes unless you have a strong reason to do so.