diff options
author | Pablo Torres <tn.pablo@gmail.com> | 2012-12-02 16:43:47 -0500 |
---|---|---|
committer | Pablo Torres <tn.pablo@gmail.com> | 2012-12-02 16:57:47 -0500 |
commit | 286e56ffe7807421b2b4a72e8386e9eb83767313 (patch) | |
tree | 99fdf21ac23a66c647de7490ee2d24ce8319f329 /guides/source | |
parent | 1d36963754d4bb0fdd563c3354ff8aae805577a0 (diff) | |
download | rails-286e56ffe7807421b2b4a72e8386e9eb83767313.tar.gz rails-286e56ffe7807421b2b4a72e8386e9eb83767313.tar.bz2 rails-286e56ffe7807421b2b4a72e8386e9eb83767313.zip |
Standardize use of "route globbing" and "wildcard segments" [ci skip]
Diffstat (limited to 'guides/source')
-rw-r--r-- | guides/source/routing.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md index 45eef7443b..714c0b609e 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -707,7 +707,7 @@ end Both the `matches?` method and the lambda gets the `request` object as an argument. -### Route Globbing +### Route Globbing and Wildcard Segments Route globbing is a way to specify that a particular parameter should be matched to all the remaining parts of a route. For example: @@ -715,7 +715,7 @@ Route globbing is a way to specify that a particular parameter should be matched get 'photos/*other', to: 'photos#unknown' ``` -This route would match `photos/12` or `/photos/long/path/to/12`, setting `params[:other]` to `"12"` or `"long/path/to/12"`. +This route would match `photos/12` or `/photos/long/path/to/12`, setting `params[:other]` to `"12"` or `"long/path/to/12"`. The fragments prefixed with a star are called "wildcard segments". Wildcard segments can occur anywhere in a route. For example: @@ -733,7 +733,7 @@ get '*a/foo/*b', to: 'test#index' would match `zoo/woo/foo/bar/baz` with `params[:a]` equals `'zoo/woo'`, and `params[:b]` equals `'bar/baz'`. -NOTE: Starting from Rails 3.1, wildcard routes will always match the optional format segment by default. For example if you have this route: +NOTE: Starting from Rails 3.1, wildcard segments will always match the optional format segment by default. For example if you have this route: ```ruby get '*pages', to: 'pages#show' |