1
0
Fork 0
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:
yuuji.yaginuma 2018-05-08 07:27:21 +09:00
parent 28a4a2fbf4
commit 834be61e61

View file

@ -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