RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: migrations xRouting x
Model Name in URL (revised)
Episode #63Dec 16, 201285 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 #350May 16, 2012108 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 #117Sep 02, 201270 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 #154May 19, 201299 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 #314Jan 09, 201299 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 #154Mar 23, 2009125 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 #147Feb 02, 200962 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 #124Aug 25, 200880 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)