From the course: Ruby on Rails 5 Essential Training

Unlock the full course today

Join today to access over 22,600 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 5 Essential Training

Start my 1-month free trial

Read action: Index

- [Narrator] In this chapter, we will learn to implement the basics of CRUD in our controllers and in our views. In the last chapter, we already created a subjects controller and we set up the routes, the actions and the views that we'll need for all eight parts of basic CRUD. Now, we're going to start by learning to implement 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. The user reviews the details, and then clicks a link to go back to the main list. Even if you've never put these exact terms to it before, I'm sure you're familiar with the concept from other websites. Let's see how we can add the index…

Contents