RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: Routing x
Handling Exceptions (revised)
Episode #53Apr 20, 2013209 comments

Handling Exceptions (revised)

By default, Rails will render a static error file when an exception occurs in production. Here you will learn how to fully customize this behavior and render dynamic error pages. (11 minutes)
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)
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)
Destroy without JavaScript (revised)
Episode #77Jun 16, 201248 comments

Destroy without JavaScript (revised)

A destroy link in Rails does not work without JavaScript. In this episode I show two techniques for gracefully degrading destroy links: button_to and a delete action. (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)
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)
Subdomains (revised)
Episode #123Jan 13, 201266 comments

Subdomains (revised)

In Rails 3.1 subdomains are easier than ever to use. Here I show how to route a subdomain to a specific controller action, generate links, nest resources, and more. (7 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)
Routing Walkthrough Part 2
Episode #232Sep 19, 201037 comments

Routing Walkthrough Part 2

In this episode we continue our look into the Rails 3 router by exploring the Mapper class. (13 minutes)
Routing Walkthrough Part 1
Episode #231Sep 13, 201064 comments

Routing Walkthrough Part 1

How does routing work internally in Rails 3? In this episode I'll walk you through the Rails code that makes routing possible. (13 minutes)