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 - Ruby on Rails Tutorial
From the course: Ruby on Rails 5 Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
(Locked)
Challenge: AdminUser CRUD2m 44s
-
(Locked)
Solution: AdminUser CRUD7m 56s
-
(Locked)
Public area10m 35s
-
(Locked)
Public area navigation6m 3s
-
(Locked)
Nesting pages in subjects9m 44s
-
(Locked)
Nesting sections in pages7m 37s
-
(Locked)
Adding RubyGems: acts_as_list8m 25s
-
(Locked)
Finishing touches3m 30s
-
(Locked)
-