1

I have a Rails 3.2 application with numerous resources. How can I change the routing so that every path has an extra directory prepended it? Obvioulsy I know how to do this on a resource by resource basis, but how do I do it to all routes?

So for example:

  • users
  • users/1
  • resources/new
  • resources/77/edit
  • assets/66

Would become:

  • cms/users
  • cms/users/1
  • cms/resources/new
  • cms/resources/77/edit
  • cms/assets/66
4

1 回答 1

1

Please check the documentation. Basically, you need:

namespace :cms do
  #all your resources
end 
于 2013-06-03T10:44:26.583 回答