From 87ba0b48cd985b83c82cb82070b3d6ea83d029bd Mon Sep 17 00:00:00 2001 From: Saulius Grigaliunas Date: Tue, 29 May 2012 22:46:58 +0100 Subject: Routing guide: route constraints are anchored by default, remove ^ character. [ci skip] --- guides/source/routing.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') 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: -get '/:id' => 'posts#show', :constraints => {:id => /^\d/} +get '/:id' => 'posts#show', :constraints => {:id => /\d/} However, note that you don't need to use anchors because all routes are anchored at the start. -- cgit v1.2.3