With standard routing mechanics map.resourceand a few nested resources, the resulting routes are unnecessarily long. Consider the following route:
site.org/users/pavelshved/blogs/blogging-horror/posts/12345
It's easy to create in routes.rb, and I'm sure it follows some useful routing logic. But it is too long and it also seems that it is not intended for human reading.
A good improvement would be to reset the controller names, so it looks like this:
site.org/pavelshved/blogging-horror/12345
Clear, simple, short. This may become ambiguous, but in my case, for example, I will not call users "users".
I tried to install :as => '', but it gives such routes: site.org//pavelshved//blogging-horror//12345when they are created by standard helpers.
Is there a way to map resources so that controller names become optional?
source
share