From the course: Ruby on Rails 6 Essential Training
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Read action: Index - Ruby on Rails Tutorial
From the course: Ruby on Rails 6 Essential Training
Read action: Index
- [Instructor] In this chapter, we will implement the basics of CRUD in our controllers and views. We already have the routes and controllers in place. We're ready to set up the actions and view templates, beginning with the index action. Reading records from the database is usually handled by two standard Rails actions, index and show. Index displays a list of records, while show displays a detailed view for a single record. The two actions work together as a common application design pattern. The application displays a list of items, the user clicks a link for one of those items, then the application shows the user a detail page for that item. After the user reviews those details, the user then clicks a link to go back to the main list. Even if you've never put these exact terms to it before, I am sure you're familiar with this concept from other websites. Let's see how we can add the index action to our subject's…
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
-
-
-
-
-
-
-
-
-
Read action: Index4m 20s
-
Read action: Show4m
-
Adding basic forms to templates4m 51s
-
Create action: New4m 12s
-
Create action: Create5m 5s
-
Using strong parameters to regulate input4m 57s
-
Update actions: Edit and update6m 19s
-
Using partials and helpers to organize code6m 36s
-
Delete actions: Delete and destroy5m 50s
-
Challenge: Pages CRUD1m 23s
-
Solution: Pages CRUD4m 50s
-
-