aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-06 11:59:58 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-06 11:59:58 -0800
commit329c82380ee886714ab4e4620e7a5b507716a794 (patch)
tree2177c3b7cf691bb201f49b52e042a66d5ea47242 /guides
parent99bb2fd892a2a876ba0f4017bd3cc87033a4deb3 (diff)
parent69f28a7d8dfc018b948d9f70fc65a8a1b7735b8f (diff)
downloadrails-329c82380ee886714ab4e4620e7a5b507716a794.tar.gz
rails-329c82380ee886714ab4e4620e7a5b507716a794.tar.bz2
rails-329c82380ee886714ab4e4620e7a5b507716a794.zip
Merge pull request #9039 from senny/warn_on_controller_option_with_ruby_constant_syntax
ruby constant syntax is not supported as routing `:controller` option.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/routing.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md
index 14f23d4020..4614169653 100644
--- a/guides/source/routing.md
+++ b/guides/source/routing.md
@@ -832,6 +832,19 @@ will recognize incoming paths beginning with `/photos` but route to the `Images`
NOTE: Use `photos_path`, `new_photo_path`, etc. to generate paths for this resource.
+For namespaced controllers you can use the directory notation. For example:
+
+```ruby
+resources :user_permissions, controller: 'admin/user_permissions'
+```
+
+This will route to the `Admin::UserPermissions` controller.
+
+NOTE: Only the directory notation is supported. specifying the
+controller with ruby constant notation (eg. `:controller =>
+'Admin::UserPermissions'`) can lead to routing problems and results in
+a warning.
+
### Specifying Constraints
You can use the `:constraints` option to specify a required format on the implicit `id`. For example: