diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index f0d3ef80ab..34d49591e2 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -555,6 +555,21 @@ module ActionDispatch # resources :posts # end # + # All routes for the above +resources+ will be accessible through +/sekret/posts+, rather than +/admin/posts+ + # + # [:module] + # The namespace for the controllers. + # + # namespace :admin, :module => "sekret" do + # resources :posts + # end + # + # The +PostsController+ here should go in the +Sekret+ namespace and so it should be defined like this: + # + # class Sekret::PostsController < ApplicationController + # # code go here + # end + # def namespace(path, options = {}) path = path.to_s options = { :path => path, :as => path, :module => path, |