RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: model xFree Episodes xActive Record x
Nested Model Form Part 1
Episode #196Jan 11, 2010184 comments

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
Episode #406Feb 13, 2013155 comments

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
Episode #193Dec 21, 200955 comments

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
Episode #177Aug 31, 200956 comments

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
Episode #382Sep 22, 2012125 comments

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
Episode #63Jul 27, 200760 comments

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
Episode #211Apr 26, 201059 comments

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
Episode #176Aug 24, 200996 comments

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
Episode #4Mar 12, 200746 comments

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
Episode #14Apr 04, 200735 comments

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)