RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: migrations xRouting x
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)
REST API Versioning
Episode #350 – May 16, 2012 – 108 comments

REST API Versioning

APIs should be consistent, but it is difficult to do this when returning a JSON response along side the HTML interface. Here I show how to add a versioned, RESTful API. The version can be determined from either the URL or HTTP headers. (10 minutes)
Semi-Static Pages (revised)
Episode #117 – Sep 02, 2012 – 70 comments

Semi-Static Pages (revised)

There are many ways to handle static pages in a Rails application. Here I show two approaches including one that uses a RESTful style PagesController to keep the content in the database (8 minutes)
Polymorphic Association (revised)
Episode #154 – May 19, 2012 – 99 comments

Polymorphic Association (revised)

A polymorphic association allows a model to belong_to different types of other models. Here I show how to make a single comment model belong to articles, photos, and events. (11 minutes)
Pretty URLs with FriendlyId
Episode #314 – Jan 09, 2012 – 99 comments

Pretty URLs with FriendlyId

If you are tired of model ids in the URL, overriding to_param can only get you so far. The friendly_id plugin can help by making it easy to generate a URL slug and maintain a history. (7 minutes)
Polymorphic Association
Episode #154 – Mar 23, 2009 – 125 comments

Polymorphic Association

Polymorphic associations can be perplexing. In this episode I show you how to set it up in Active Record and then move to the controller and view layer. (8 minutes)
Sortable Lists
Episode #147 – Feb 02, 2009 – 62 comments

Sortable Lists

Creating drag & drop sortable lists is fairly easy using Prototype and the built in helper methods. See how in this episode. (8 minutes)
Beta Invitations
Episode #124 – Aug 25, 2008 – 80 comments

Beta Invitations

You know those invitation systems where a given user can invite a number of other people to join? That's what I show you how to make in this episode. (22 minutes)