mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #39775 from mehagar/segment_instead_of_fragment
Use segment instead of fragment in docs [ci-skip]
This commit is contained in:
commit
86480e71fa
1 changed files with 2 additions and 2 deletions
|
@ -592,7 +592,7 @@ TIP: By default, dynamic segments don't accept dots - this is because the dot is
|
||||||
|
|
||||||
### Static Segments
|
### Static Segments
|
||||||
|
|
||||||
You can specify static segments when creating a route by not prepending a colon to a fragment:
|
You can specify static segments when creating a route by not prepending a colon to a segment:
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
get 'photos/:id/with_user/:user_id', to: 'photos#show'
|
get 'photos/:id/with_user/:user_id', to: 'photos#show'
|
||||||
|
@ -759,7 +759,7 @@ Route globbing is a way to specify that a particular parameter should be matched
|
||||||
get 'photos/*other', to: 'photos#unknown'
|
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"`. The fragments prefixed with a star are called "wildcard segments".
|
This route would match `photos/12` or `/photos/long/path/to/12`, setting `params[:other]` to `"12"` or `"long/path/to/12"`. The segments prefixed with a star are called "wildcard segments".
|
||||||
|
|
||||||
Wildcard segments can occur anywhere in a route. For example:
|
Wildcard segments can occur anywhere in a route. For example:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue