diff options
Diffstat (limited to 'guides/source/routing.textile')
-rw-r--r-- | guides/source/routing.textile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/routing.textile b/guides/source/routing.textile index 51d7c85fca..0773a96c67 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. |