aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source
diff options
context:
space:
mode:
authorBrendon Murphy <xternal1+github@gmail.com>2013-02-26 09:43:32 -0800
committerBrendon Murphy <xternal1+github@gmail.com>2013-02-26 09:43:32 -0800
commita025cd743cbe26a9ff1a662fb9e6aa917bebd842 (patch)
treee6e4bba7c0ab65db255c409451b3c8b5a0a0662d /guides/source
parentb1dee8c2535b2bca6ebe69d18c24d29f9ba19470 (diff)
downloadrails-a025cd743cbe26a9ff1a662fb9e6aa917bebd842.tar.gz
rails-a025cd743cbe26a9ff1a662fb9e6aa917bebd842.tar.bz2
rails-a025cd743cbe26a9ff1a662fb9e6aa917bebd842.zip
Add routing guide doc on root with namespaces.
I read #9419 and realized I didn't know you could have namespaced roots, checked around, and a few friends didn't either. Figured this makes it guide worthy.
Diffstat (limited to 'guides/source')
-rw-r--r--guides/source/routing.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md
index 4614169653..2190bc493e 100644
--- a/guides/source/routing.md
+++ b/guides/source/routing.md
@@ -797,6 +797,16 @@ You should put the `root` route at the top of the file, because it is the most p
NOTE: The `root` route only routes `GET` requests to the action.
+You can also use root inside namespaces and scopes as well. For example:
+
+```ruby
+namespace :admin do
+ root to: "admin#index"
+end
+
+root to: "home#index"
+```
+
### Unicode character routes
You can specify unicode character routes directly. For example: