Nested resource

At: Getting Started with Rails — Ruby on Rails Guides

Under: 7.3 Adding a Route for Comments

For the following:

resources :posts do resources :comments end

It says:

This creates comments as a nested resource within posts. This is another part of capturing the hierarchical relationship that exists between posts and comments.

Does this mean that we made resources :comments nested in resources :posts based on the model relationship?

What is we just listed resources :comments without nesting?

Thanks.

Does this mean that we made resources :comments nested in resources :posts based on the model relationship?

yes

Please read section 2.7 of

Sijo

Sijo k g wrote:

Does this mean that we made resources :comments nested in resources :posts based on the model relationship?

yes

Please read section 2.7 of Rails Routing from the Outside In — Ruby on Rails Guides

Sijo

Thanks Sijo.