Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document the :module option for namespace

  • Loading branch information...
commit 66d1276d7f38ddb002f1dd48e77cea383497f57d 1 parent 0eef4e3
@radar radar authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 actionpack/lib/action_dispatch/routing/mapper.rb
View
15 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -555,6 +555,21 @@ def controller(controller, options={})
# 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,
Please sign in to comment.
Something went wrong with that request. Please try again.