From the course: Ruby on Rails 5 Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Nesting pages in subjects

Nesting pages in subjects - Ruby on Rails Tutorial

From the course: Ruby on Rails 5 Essential Training

Start my 1-month free trial

Nesting pages in subjects

- [Narrator] In our simple CMS application, we have one controller for the subjects, one for the pages, and one for the section. And that's how it should be. Each area should have its own controller with its own crud. That follows the model for rest. The problem is that they're completely separate. Our application would be more usable if instead of going directly to a list of all pages, you first selected a subject from the subjects list. And then you saw a pages list of pages only for that subject. Then you'd pick a page from that list to see a list of sections for that page only. It would be more of a tree structure that we navigated down. Let's walk through the process of nesting pages inside subjects together. And then you can try to do the same thing for sections on your own. Let's first start by getting an overview. The place we're gonna start is from the subjects index page. From the list of all the subjects, we're gonna have a link that will take you to that subject's index…

Contents