http://nithinbekal.com/posts/rails-shallow-nesting/
You can use shallow nesting instead.
resources :posts, shallow: true do
resources :comments do
resources :replies do
end
end
This way you only have a nested route when you need to create a nested object [new and create action] or see all the related objects [index view]. Look at the first three lines below to see what i mean. And then you have normal routes for the resources that dont need to know the relation.
comment_replies GET /comments/:comment_id/replies(.:format) replies#index
POST /comments/:comment_id/replies(.:format) replies#create
new_comment_reply GET /comments/:comment_id/replies/new(.:format) replies#new
edit_reply GET /replies/:id/edit(.:format) replies#edit
reply GET /replies/:id(.:format) replies#show
PATCH /replies/:id(.:format) replies#update
PUT /replies/:id(.:format) replies#update
DELETE /replies/:id(.:format) replies#destroy
post_comments GET /posts/:post_id/comments(.:format) comments#index
POST /posts/:post_id/comments(.:format) comments#create
new_post_comment GET /posts/:post_id/comments/new(.:format) comments#new
edit_comment GET /comments/:id/edit(.:format) comments#edit
comment GET /comments/:id(.:format) comments#show
PATCH /comments/:id(.:format) comments#update
PUT /comments/:id(.:format) comments#update
DELETE /comments/:id(.:format) comments#destroy
posts GET /posts(.:format) posts#index
POST /posts(.:format) posts#create
new_post GET /posts/new(.:format) posts#new
edit_post GET /posts/:id/edit(.:format) posts#edit
post GET /posts/:id(.:format) posts#show
PATCH /posts/:id(.:format) posts#update
PUT /posts/:id(.:format) posts#update
DELETE /posts/:id(.:format)