aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorTima Maslyuchenko <dudapip3@gmail.com>2012-02-26 19:27:57 +0200
committerTima Maslyuchenko <dudapip3@gmail.com>2012-02-26 19:27:57 +0200
commita3a73c4465f8860bf9c98809f41e8dd54466287c (patch)
tree50e0075b2a1a313ca7bd71df62f533d63648b88a /railties
parent1e25d6217cfac78e0ca1c1e97c539b05dc472dd6 (diff)
downloadrails-a3a73c4465f8860bf9c98809f41e8dd54466287c.tar.gz
rails-a3a73c4465f8860bf9c98809f41e8dd54466287c.tar.bz2
rails-a3a73c4465f8860bf9c98809f41e8dd54466287c.zip
fixed regular expression in Specifying Constraints section
Diffstat (limited to 'railties')
-rw-r--r--railties/guides/source/routing.textile4
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index df2bd9d0c9..5d23e643eb 100644
--- a/railties/guides/source/routing.textile
+++ b/railties/guides/source/routing.textile
@@ -650,7 +650,7 @@ h4. Specifying Constraints
You can use the +:constraints+ option to specify a required format on the implicit +id+. For example:
<ruby>
-resources :photos, :constraints => {:id => /[A-Z][A-Z][0-9]+/}
+resources :photos, :constraints => {:id => /[a-z][A-Z][0-9]+/}
</ruby>
This declaration constrains the +:id+ parameter to match the supplied regular expression. So, in this case, the router would no longer match +/photos/1+ to this route. Instead, +/photos/RR27+ would match.
@@ -658,7 +658,7 @@ This declaration constrains the +:id+ parameter to match the supplied regular ex
You can specify a single constraint to apply to a number of routes by using the block form:
<ruby>
-constraints(:id => /[A-Z][A-Z][0-9]+/) do
+constraints(:id => /[a-z][A-Z][0-9]+/) do
resources :photos
resources :accounts
end