diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:05:55 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:05:55 +1000 |
commit | 66d1276d7f38ddb002f1dd48e77cea383497f57d (patch) | |
tree | adab582ac6d784f698486f03e0d7a5513abbc2b0 /actionpack/lib/action_dispatch/routing | |
parent | 0eef4e3bfb3435f2906c70c19ff896393f94abdf (diff) | |
download | rails-66d1276d7f38ddb002f1dd48e77cea383497f57d.tar.gz rails-66d1276d7f38ddb002f1dd48e77cea383497f57d.tar.bz2 rails-66d1276d7f38ddb002f1dd48e77cea383497f57d.zip |
Document the :module option for namespace
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, |