aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-11-07 12:05:55 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-11-07 12:05:55 +1000
commit66d1276d7f38ddb002f1dd48e77cea383497f57d (patch)
treeadab582ac6d784f698486f03e0d7a5513abbc2b0 /actionpack/lib/action_dispatch/routing/mapper.rb
parent0eef4e3bfb3435f2906c70c19ff896393f94abdf (diff)
downloadrails-66d1276d7f38ddb002f1dd48e77cea383497f57d.tar.gz
rails-66d1276d7f38ddb002f1dd48e77cea383497f57d.tar.bz2
rails-66d1276d7f38ddb002f1dd48e77cea383497f57d.zip
Document the :module option for namespace
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb15
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,