diff options
author | Xavier Noria <fxn@hashref.com> | 2010-12-11 00:55:25 +0100 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-12-11 00:55:25 +0100 |
commit | c6612d2bb34e7104a7b1be0dedb0e1ad9596f160 (patch) | |
tree | 1c3bde09706831c3913614fbc8a69a223a924aca /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | e07772556a2167e44158f367beb3a45e6a55671f (diff) | |
parent | d38644f4a9eead2f9d9ed96e10fb67430de31789 (diff) | |
download | rails-c6612d2bb34e7104a7b1be0dedb0e1ad9596f160.tar.gz rails-c6612d2bb34e7104a7b1be0dedb0e1ad9596f160.tar.bz2 rails-c6612d2bb34e7104a7b1be0dedb0e1ad9596f160.zip |
Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
activerecord/lib/active_record/transactions.rb
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 47de5848fa..430fcdbe07 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -247,7 +247,11 @@ module ActionDispatch # # root :to => 'pages#main' # - # You should put the root route at the end of <tt>config/routes.rb</tt>. + # For options, see the +match+ method's documentation, as +root+ uses it internally. + # + # You should put the root route at the top of <tt>config/routes.rb</tt>, + # because this means it will be matched first. As this is the most popular route + # of most Rails applications, this is beneficial. def root(options = {}) match '/', options.reverse_merge(:as => :root) end @@ -269,18 +273,18 @@ module ActionDispatch # Mount a Rack-based application to be used within the application. # - # mount SomeRackApp, :at => "some_route" + # mount SomeRackApp, :at => "some_route" # # Alternatively: # - # mount(SomeRackApp => "some_route") + # mount(SomeRackApp => "some_route") # # All mounted applications come with routing helpers to access them. # These are named after the class specified, so for the above example # the helper is either +some_rack_app_path+ or +some_rack_app_url+. # To customize this helper's name, use the +:as+ option: # - # mount(SomeRackApp => "some_route", :as => "exciting") + # mount(SomeRackApp => "some_route", :as => "exciting") # # This will generate the +exciting_path+ and +exciting_url+ helpers # which can be used to navigate to this mounted app. @@ -563,7 +567,7 @@ module ActionDispatch # admin_post DELETE /admin/posts/:id(.:format) {:action=>"destroy", :controller=>"admin/posts"} # === Supported options # - # The +:path+, +:as+, +:module+, +:shallow_path+ and +:shallow_prefix+ all default to the name of the namespace. + # The +:path+, +:as+, +:module+, +:shallow_path+ and +:shallow_prefix+ options all default to the name of the namespace. # # [:path] # The path prefix for the routes. @@ -1085,6 +1089,7 @@ module ActionDispatch end end + # See ActionDispatch::Routing::Mapper::Scoping#namespace def namespace(path, options = {}) if resource_scope? nested { super } |