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
|
@ -1141,8 +1141,8 @@ resources :videos, param: :identifier
|
|||
```
|
||||
videos GET /videos(.:format) videos#index
|
||||
POST /videos(.:format) videos#create
|
||||
new_videos GET /videos/new(.:format) videos#new
|
||||
edit_videos GET /videos/:identifier/edit(.:format) videos#edit
|
||||
new_video GET /videos/new(.:format) videos#new
|
||||
edit_video GET /videos/:identifier/edit(.:format) videos#edit
|
||||
```
|
||||
|
||||
```ruby
|
||||
|
@ -1160,7 +1160,7 @@ class Video < ApplicationRecord
|
|||
end
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue