RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: model xFree Episodes x
Model Versioning
Episode #177Aug 31, 200956 comments

Model Versioning

If you need to keep track of a model's history of changes and switch between versions, consider using the vestal_versions gem like I show in this episode. (9 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)
Tagging
Episode #382Sep 22, 2012125 comments

Tagging

There are several gems to help implement tags in a Rails app. Here I show you how to integrate acts-as-taggable-on and then show how to do it from scratch. (11 minutes)
How I Test
Episode #275Jul 18, 2011137 comments

How I Test

Here I show how I would add tests to the password reset feature created in the previous episode. I use RSpec, Capybara, Factory Girl, and Guard to make request, model, and mailer specs. (15 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)
Ransack
Episode #370Aug 03, 201293 comments

Ransack

Ransack allows you to easily build complex search forms. It also helps in adding sortable links and building a dynamic advanced search page. (10 minutes)
Undo with Paper Trail
Episode #255Feb 28, 201146 comments

Undo with Paper Trail

Undo and redo behavior is easy to add with a versioning gem such as Paper Trail. Learn how to add an undo link to any model's flash message. (13 minutes)
Securing an API
Episode #352May 23, 201274 comments

Securing an API

There are many approaches to locking down an API. Here I start off with HTTP Basic authentication then move on to generating a unique token which can be passed through a URL parameter or HTTP header. (7 minutes)
Non Active Record Model
Episode #121Aug 04, 200846 comments

Non Active Record Model

This episode will show you how to make a model which isn't based on Active Record. You may want to do this if a resource isn't backed by the database. (12 minutes)
OmniAuth Identity
Episode #304Dec 05, 201185 comments

OmniAuth Identity

With the release of OmniAuth 1.0 there is a new Identity strategy which allows users to register/login with a password if they don't want to use an external provider. (11 minutes)