Types
- Free Episodes
- Pro Episodes
- Revised Episodes
Categories
- Active Record
- Active Resource
- Active Support
- Administration
- Ajax
- APIs
- Authentication
- Authorization
- Background Jobs
- Caching
- Code Walkthrough
- Controllers
- Debugging
- Deployment
- eCommerce
- Forms
- Mailing
- Models
- Performance
- Plugins
- Production
- Rack
- Rails 2.0
- Rails 2.1
- Rails 2.2
- Rails 2.3
- Rails 3.0
- Rails 3.1
- Rails 3.2
- Rails 4.0
- Refactoring
- Routing
- Search
- Security
- Testing
- Tools
- Views
Nested Model Form Part 1
Handling multiple models in a single form is much easier with the accepts_nested_attributes_for method. See how to use this method to handle nested model fields.
(11 minutes)
Public Activity
Learn how to easily add a user activity feed using the public_activity gem. Here I show both the default setup using model callbacks and a manual way to trigger activities.
(10 minutes)
Tableless Model
If you want to create a model without a database backend, you simply need to define a couple methods in the model like I show in this episode.
(8 minutes)
Model Versioning
If you need to keep track of a model's history of changes and switch between versions, consider using the vestal_versions gem like I show in this episode.
(9 minutes)
Tagging
There are several gems to help implement tags in a Rails app. Here I show you how to integrate acts-as-taggable-on and then show how to do it from scratch.
(11 minutes)
Model Name in URL
By default, Rails uses the model's id in the URL. What if you want to use the name of the model instead? You can change this behavior by overriding the to_param method in the model. Watch this episode for details.
(6 minutes)
Validations in Rails 3
Rails 3 offers several new additions to validations. Here learn how to make a custom error_messages partial, reflect on validations, and clean up complex validations in a model.
(9 minutes)
Searchlogic
Searchlogic makes searching models easier than ever with its assortment of named scopes. In this episode I show you how to create simple and advanced searches.
(13 minutes)
Move Find into Model
Move a find into the model to clean up the controllers and remove duplication. Also see how you can call these custom find methods through an association.
(2 minutes)
Performing Calculations on Models
Did you know ActiveRecord provides class methods for performing calculations on models? You can even use these methods through associations.
(2 minutes)