After learning the steps necessary for nesting resources, learn to nest sections inside of pages.
- [Narrator] At the end of the last movie,…I asked you to try on your own,…to nest these sections inside the pages.…In this movie, let's take a look at it.…First, let's take a look at what the end results look like.…We have one link for manage content now.…When I click on that, I get a list of my subjects.…When I click view pages,…I get a list of the pages for that subject.…When I click view sections,…I get a list of these sections for that page only.…Notice up here that page ID is being maintained,…and as I click around, Page ID is always still there.…
So these are always scoped by this page.…Let's take a look at the code.…The first thing I did, was I went into pages index,…and I added this view sections link.…That's gonna go to the sections path.…The list of sections and pass in page ID at the same time.…Then, I went into my sections controller,…and I added a new before action for find page.…I added a new method, down here at the bottom,…for finding that page.…And it assigns the page to at page,…so it's always available to me.…
- 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.