RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: rails x
Caching in Rails 2.1
Episode #115 – Jun 23, 2008 – 78 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 #392 – Nov 17, 2012 – 93 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 #343 – Apr 17, 2012 – 131 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 #238 – Jul 28, 2012 – 76 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 #368 – Jul 24, 2012 – 107 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 #376 – Aug 30, 2012 – 81 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 #254 – Feb 21, 2011 – 91 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 #269 – Jun 06, 2011 – 43 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 #391 – Nov 07, 2012 – 84 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 #154 – May 19, 2012 – 99 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)