RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: rails x
Caching in Rails 2.1
Episode #115Jun 23, 200878 comments

Caching in Rails 2.1

Rails 2.1 brings some new caching features which makes it very easy to cache any values including models. See how in this episode. (8 minutes)
A Tour of State Machines
Episode #392Nov 17, 201293 comments

A Tour of State Machines

Here I show how three popular state machine gems can be used to clean up a list of boolean/datetime fields. I also show a custom solution which keeps track of the history of events. (12 minutes)
Full-Text Search in PostgreSQL
Episode #343Apr 17, 2012131 comments

Full-Text Search in PostgreSQL

Postgres offers full-text searching right out of the box. This episode shows how to write queries from scratch, apply tools like Texticle and pg_search, and optimize performance through indexes. (16 minutes)
Mongoid (revised)
Episode #238Jul 28, 201276 comments

Mongoid (revised)

Mongoid is a Ruby gem for interacting with MongoDB. Here I show the basics of setting up an app, querying for records, adding embedded associations, overriding the id, and more. (9 minutes)
MiniProfiler
Episode #368Jul 24, 2012107 comments

MiniProfiler

MiniProfiler allows you to see the speed of a request conveniently on the page. It also shows the SQL queries performed and allows you to profile a specific block of code. (9 minutes)
JRuby Basics
Episode #376Aug 30, 201281 comments

JRuby Basics

JRuby is a polished and stable Ruby implementation. Here I show the basics of setting it up and executing Java from within Ruby. I also see how it compares with MRI at running threads. (10 minutes)
Pagination with Kaminari
Episode #254Feb 21, 201191 comments

Pagination with Kaminari

If you need pagination in Rails 3 try out Kaminari. It is a clean, flexible solution which uses scopes to flow nicely with Active Record queries. Did I mention it also works with Mongoid? (8 minutes)
Template Inheritance
Episode #269Jun 06, 201143 comments

Template Inheritance

In Rails 3.1 the controller inheritance also applies to the view layer. Here I show how to add an application template which is shared by all views, and a lookup path for overriding templates based on the subdomain. (8 minutes)
Testing JavaScript with PhantomJS
Episode #391Nov 07, 201284 comments

Testing JavaScript with PhantomJS

PhantomJS allows us to test JavaScript without going through a browser window. Here I show how to do this using Capybara and Poltergeist. I also give some tips on handling database transactions and skipping javascript tests. (10 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)