aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2011-02-14 00:40:53 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2011-02-14 01:01:20 +0000
commitfd7605826a6e4f7590e4abf42c6c9d0923afc4ef (patch)
tree050282052ae4fdf2154f7a428e81f826652273c9 /actionpack
parent48fe62ee571002bdee694a5722285d4055a5e695 (diff)
downloadrails-fd7605826a6e4f7590e4abf42c6c9d0923afc4ef.tar.gz
rails-fd7605826a6e4f7590e4abf42c6c9d0923afc4ef.tar.bz2
rails-fd7605826a6e4f7590e4abf42c6c9d0923afc4ef.zip
Add notes on how to override the default :id constraint [#5994 state:resolved]
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 2f12192af4..85c09a3fda 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -847,6 +847,14 @@ module ActionDispatch
# resources :posts, :comments
# end
#
+ # By default the :id parameter doesn't accept dots. If you need to
+ # use dots as part of the :id parameter add a constraint which
+ # overrides this restriction, e.g:
+ #
+ # resources :articles, :id => /[^\/]+/
+ #
+ # This allows any character other than a slash as part of your :id.
+ #
module Resources
# CANONICAL_ACTIONS holds all actions that does not need a prefix or
# a path appended since they fit properly in their scope level.
@@ -1103,7 +1111,6 @@ module ActionDispatch
#
# # resource actions are at /admin/posts.
# resources :posts, :path => "admin"
- #
def resources(*resources, &block)
options = resources.extract_options!