RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: rails xActive Record x
Rails 2.3 Extras
Episode #152 – Mar 09, 2009 – 55 comments

Rails 2.3 Extras

This episode finishes up this series on Rails 2.3. Here you will learn about several smaller additions in 2.3. (9 minutes)
Multitenancy with Scopes
Episode #388 – Oct 20, 2012 – 120 comments

Multitenancy with Scopes

A multi-tenant application can be difficult to implement because the data for each tenant must be completely separate. Here I show how to do this using subdomains and default scopes in Active Record. (12 minutes)
Site-Wide Announcements (revised)
Episode #103 – Nov 12, 2012 – 95 comments

Site-Wide Announcements (revised)

Here I show how to add an announcement message at the top of every page in the application and allow the user to permanently hide it. This is all done test-first and even includes testing the JavaScript behavior. (11 minutes)
Multitenancy with PostgreSQL
Episode #389 – Oct 27, 2012 – 112 comments

Multitenancy with PostgreSQL

PostgreSQL Schemas can help create a multi-tenant app by keeping data separate at the database layer. Integrating with migrations can be tricky though, so watch this episode for the full details. (11 minutes)
Model Name in URL (revised)
Episode #63 – Dec 16, 2012 – 85 comments

Model Name in URL (revised)

A model's ID in the URL is not very helpful to the user. Consider adding the name which can also improve SEO. Learn how to override to_param, add a slug attribute, and make a catch all route for deep nesting. (9 minutes)
Optimistic Locking (revised)
Episode #59 – Aug 04, 2012 – 135 comments

Optimistic Locking (revised)

There is a chance one user will unintentionally override someone else's changes if they update a record near the same time. One solution is to use optimistic locking. The updated_at column can also be used for this as shown. (8 minutes)
Rails 2.2 Extras
Episode #140 – Dec 15, 2008 – 45 comments

Rails 2.2 Extras

This episode finishes up the Rails 2.2 series by showing a few miscellaneous additions that I find useful. (4 minutes)
STI and Polymorphic Associations
Episode #394 – Nov 25, 2012 – 81 comments

STI and Polymorphic Associations

Single Table Inheritance (STI) can help organize branching logic into separate classes, but a polymorphic association may be a better fit if there are unique database columns. (14 minutes)
Advanced Queries in Rails 3
Episode #215 – May 24, 2010 – 53 comments

Advanced Queries in Rails 3

Learn some advanced techniques regarding named scopes and get an introduction to Arel in this episode. (9 minutes)
Caching in Rails 2.1
Episode #115 – Jun 23, 2008 – 78 comments

Caching in Rails 2.1

Rails 2.1 brings some new caching features which makes it very easy to cache any values including models. See how in this episode. (8 minutes)