ActiveRecord is a code library in Rails that implements the active record design pattern for working with database data in an object-oriented way. Our models understand the structure of the database and use simple methods to interact with the database by generating complex SQL statements for us. ActiveRelation is the system for generating those complex queries and allows us to combine and add to queries and always get sensible SQL as a result.
- [Narrator] ActiveRecord and ActiveRelation…are part of the Rails framework…that's going to power our models.…So before we begin coding on our models…let's get a big picture understanding of how they work.…Active record, when it's written all lowercase…as two separate words…refers to a commonly used design pattern…for working with relational databases.…It's not Rail specific.…You could use the active record pattern…in any programming language.…It's an approach to designing object oriented software.…ActiveRecord, when it's written as one word…with a capital A and R, refers to the Rails implementation…of the active record pattern.…
Often you can use the terms interchangeably…but it's helpful to understand the context…and to know the difference.…The ActiveRecord design pattern…allows you to retrieve database data as objects.…And then to work with them in an object oriented way.…Not just as static rows of data.…If you've ever worked with database data as rows…you know it can be cumbersome.…Instead, ActiveRecord makes our objects intelligent.…
- 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.