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

Read action: Index - Ruby on Rails Tutorial

From the course: Ruby on Rails 6 Essential Training

Start my 1-month free trial

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…

Contents