Nesting is a technique for putting one resource inside another resource so that they are navigated as a tree. Learn the steps necessary to nest pages inside of 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.…So we'll link to the PagesController to the index action.…
- Creating and configuring a new Ruby on Rails project
- Generating controllers and views
- Handling server requests
- Using different types of routes
- Rendering and viewing templates
- Generating migrations and models
- Creating, updating, and deleting records
- Finding records with queries
- Understanding relationship types
- Writing controllers for CRUD
- Working with layouts and helpers
- Managing application assets
- Building forms
- Validating data
- Authenticating users
Skill Level Beginner
1. What Is Ruby on Rails?
2. Get Started
3. Controllers, Views, and Dynamic Content
4. Databases and Migrations
5. Models and ActiveRecord
7. CRUD, REST, and Resourceful Routes
8. Controllers and CRUD
9. Layouts, Partials, and View Helpers
12. Data Validation
13. Controller Features
14. User Authentication
15. Improve the Simple CMS
Next steps1m 44s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.