aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaulius Grigaliunas <saulius@ninja.lt>2012-05-29 22:46:58 +0100
committerSaulius Grigaliunas <saulius@ninja.lt>2012-05-29 22:46:58 +0100
commit87ba0b48cd985b83c82cb82070b3d6ea83d029bd (patch)
treee34c7dad0d921114757726c8517007fdeb508068
parent97fb1b6e65f1b75c13aeca5a96591f21012c2014 (diff)
downloadrails-87ba0b48cd985b83c82cb82070b3d6ea83d029bd.tar.gz
rails-87ba0b48cd985b83c82cb82070b3d6ea83d029bd.tar.bz2
rails-87ba0b48cd985b83c82cb82070b3d6ea83d029bd.zip
Routing guide: route constraints are anchored by default, remove ^ character. [ci skip]
-rw-r--r--guides/source/routing.textile2
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/routing.textile b/guides/source/routing.textile
index 0773a96c67..51d7c85fca 100644
--- a/guides/source/routing.textile
+++ b/guides/source/routing.textile
@@ -486,7 +486,7 @@ get 'photos/:id' => 'photos#show', :id => /[A-Z]\d{5}/
+:constraints+ takes regular expressions with the restriction that regexp anchors can't be used. For example, the following route will not work:
<ruby>
-get '/:id' => 'posts#show', :constraints => {:id => /^\d/}
+get '/:id' => 'posts#show', :constraints => {:id => /\d/}
</ruby>
However, note that you don't need to use anchors because all routes are anchored at the start.