[英]ruby on rails rename nested resources
I have following routes 我有以下路线
resources :posts, path: :blog do
resources :comments, path: :comments do
end
end
devise_scope :user do
resources :posts, path: :blog do
resources :comments do
end
end
end
this gives me 这给了我
post_comments GET /news/:post_id/comments(.:format) comments#index
POST /news/:post_id/comments(.:format) comments#create
new_post_comment GET /news/:post_id/comments/new(.:format) comments#new
edit_post_comment GET /news/:post_id/comments/:id/edit(.:format) comments#edit
post_comment GET /news/:post_id/comments/:id(.:format) comments#show
PATCH /news/:post_id/comments/:id(.:format) comments#update
PUT /news/:post_id/comments/:id(.:format) comments#update
DELETE /news/:post_id/comments/:id(.:format) comments#destroy
posts GET /news(.:format) posts#index
POST /news(.:format) posts#create
new_post GET /news/new(.:format) posts#new
edit_post GET /news/:id/edit(.:format) posts#edit
post GET /news/:id(.:format) posts#show
PATCH /news/:id(.:format) posts#update
PUT /news/:id(.:format) posts#update
DELETE /news/:id(.:format) posts#destroy
GET /news/:post_id/comments(.:format) comments#index
POST /news/:post_id/comments(.:format) comments#create
GET /news/:post_id/comments/new(.:format) comments#new
GET /news/:post_id/comments/:id/edit(.:format) comments#edit
GET /news/:post_id/comments/:id(.:format) comments#show
PATCH /news/:post_id/comments/:id(.:format) comments#update
PUT /news/:post_id/comments/:id(.:format) comments#update
DELETE /news/:post_id/comments/:id(.:format) comments#destroy
GET /news(.:format) posts#index
POST /news(.:format) posts#create
GET /news/new(.:format) posts#new
GET /news/:id/edit(.:format) posts#edit
GET /news/:id(.:format) posts#show
PATCH /news/:id(.:format) posts#update
PUT /news/:id(.:format) posts#update
DELETE /news/:id(.:format) posts#destroy
root GET / posts#index
Thank you ! 谢谢 !
您多次调用帖子,路径,博客和评论的资源,只是在更改顺序,但链接是相同的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.