mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix named route parameter example [ci skip]
The prefix of `new` and `edit` generated by `resources` is singular.
This commit is contained in:
parent
28a4a2fbf4
commit
834be61e61
1 changed files with 5 additions and 5 deletions
|
@ -1139,10 +1139,10 @@ resources :videos, param: :identifier
|
||||||
```
|
```
|
||||||
|
|
||||||
```
|
```
|
||||||
videos GET /videos(.:format) videos#index
|
videos GET /videos(.:format) videos#index
|
||||||
POST /videos(.:format) videos#create
|
POST /videos(.:format) videos#create
|
||||||
new_videos GET /videos/new(.:format) videos#new
|
new_video GET /videos/new(.:format) videos#new
|
||||||
edit_videos GET /videos/:identifier/edit(.:format) videos#edit
|
edit_video GET /videos/:identifier/edit(.:format) videos#edit
|
||||||
```
|
```
|
||||||
|
|
||||||
```ruby
|
```ruby
|
||||||
|
@ -1160,7 +1160,7 @@ class Video < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
video = Video.find_by(identifier: "Roman-Holiday")
|
video = Video.find_by(identifier: "Roman-Holiday")
|
||||||
edit_videos_path(video) # => "/videos/Roman-Holiday/edit"
|
edit_video_path(video) # => "/videos/Roman-Holiday/edit"
|
||||||
```
|
```
|
||||||
|
|
||||||
Inspecting and Testing Routes
|
Inspecting and Testing Routes
|
||||||
|
|
Loading…
Reference in a new issue