aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/routing.textile
diff options
context:
space:
mode:
authorTima Maslyuchenko <dudapip3@gmail.com>2012-02-26 20:58:12 +0200
committerTima Maslyuchenko <dudapip3@gmail.com>2012-02-26 20:58:12 +0200
commit25ad2e934538e65141fc6dccbeecdb280017284b (patch)
treee61ef1ad4b1a677c315cb387d1a8dfb134954f56 /railties/guides/source/routing.textile
parentd4b35934d173fca4fad54ca8e88d1366462b2432 (diff)
downloadrails-25ad2e934538e65141fc6dccbeecdb280017284b.tar.gz
rails-25ad2e934538e65141fc6dccbeecdb280017284b.tar.bz2
rails-25ad2e934538e65141fc6dccbeecdb280017284b.zip
reverted regular expression fix
Diffstat (limited to 'railties/guides/source/routing.textile')
-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 5d23e643eb..df2bd9d0c9 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