RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: migrations xRevised Episodes x
Optimistic Locking (revised)
Episode #59Aug 04, 2012135 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)
Devise and OmniAuth (revised)
Episode #235Jul 13, 2012134 comments

Devise and OmniAuth (revised)

In this episode I build upon a standard Devise setup and show how to add 3rd party authentication using OmniAuth. This includes support for user validations and is compatible with normal password authentication. (10 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)
Time Zones (revised)
Episode #106Oct 28, 201293 comments

Time Zones (revised)

Active Support makes it easy to work with time zones. Learn how to add a Time Zone select field to a user form and watch out for the gotchas. (7 minutes)
Tree-Based Navigation (revised)
Episode #162Dec 01, 201293 comments

Tree-Based Navigation (revised)

If your Rails app is content-heavy, consider organizing it in a tree menu structure. Here I show how to add top-level tabs, nested links in a side bar, and breadcrumbs to go up the hierarchy. (10 minutes)
Devise (revised)
Episode #209Jul 06, 201275 comments

Devise (revised)

Devise is one of the most popular authentication plugins for Rails. Here I show how to set it up with a User model and configure the modules, views, routes, and more. (8 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)
Simple OmniAuth (revised)
Episode #241Jun 02, 201291 comments

Simple OmniAuth (revised)

OmniAuth makes it easy to do user authentication through a third party provider such as Twitter or Facebook. Learn a simple approach in this episode. (11 minutes)
Sortable Lists (revised)
Episode #147Oct 13, 2011131 comments

Sortable Lists (revised)

Here I show how to use jQuery UI to make a sortable list and a "sort" action to handle the updating. Top it off with acts_as_list to make it feature complete. (6 minutes)