Learn to implement a basic “index” action by writing controller code and the related HTML for the view template. The index action is a Read operation which displays a list of database records.
- [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 action…in our subject's controller.…
- 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.