diff --git a/guides/source/routing.textile b/guides/source/routing.textile index 0773a96c67075e8b39bb6f55bb3a5c6c210684e0..51d7c85fca77e4f1c5ec6a9cf68b3ff2820feb1f 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.