RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: association x
Find Through Association
Episode #3Mar 08, 200745 comments

Find Through Association

No need to pass foreign keys in find conditions, just do the find through a has_many association. (2 minutes)
Touch and Cache
Episode #172Jul 27, 200952 comments

Touch and Cache

Rails 2.3.3 brings us a new feature called "touch". See how to use this to auto-expire associated caches in this episode. (6 minutes)
Tree Based Navigation
Episode #162May 18, 200970 comments

Tree Based Navigation

The acts_as_tree plugin provides many methods for handling a tree based association. In this episode I show how to build a navigation system with tabs, subpages, and breadcrumbs. (11 minutes)
Authorization with CanCan
Episode #192Dec 14, 2009114 comments

Authorization with CanCan

CanCan is a simple authorization plugin that offers a lot of flexibility. See how to use it in this episode. (15 minutes)
Complex Forms Part 3
Episode #75Oct 15, 2007270 comments

Complex Forms Part 3

In this third and final episode on complex forms I will show you how to edit a project and multiple tasks all in one form. This includes removing and adding tasks dynamically as well. See the show notes for updated code. (16 minutes)
Session Based Model
Episode #119Jul 21, 200863 comments

Session Based Model

If you have a lot of logic associated with the data inside a session, you'll need some central location to put this logic. See how to create a session based model in this episode. (13 minutes)
HABTM Checkboxes
Episode #17Apr 11, 2007115 comments

HABTM Checkboxes

It is often asked: how do I create a list of checkboxes for managing a HABTM association? Ask no more because this episode will show you how to do exactly that. (6 minutes)
Two Many-to-Many
Episode #47Jun 20, 200778 comments

Two Many-to-Many

There are two different ways to set up a many-to-many association in Rails. In this episode you will see how to implement both ways along with some tips on choosing the right one for your project. (9 minutes)
Hackers Love Mass Assignment
Episode #26May 02, 200767 comments

Hackers Love Mass Assignment

Your site may be at risk! When using mass assignment, you are giving the user complete control over that model and its associations. See how a hacker might use this vulnerability and learn how to stop it in this episode. (6 minutes)
Counter Cache Column
Episode #23Apr 25, 200769 comments

Counter Cache Column

If you need to display the record count for a has_many association, you can improve performance by caching that number in a column. (7 minutes)