RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: Pro Episodes x
Autocomplete Search Terms
Episode #399Dec 31, 201290 comments

Autocomplete Search Terms

Learn how to add autocompletion to a search form and improve performance using Rack middleware, caching and switching from SQL to Redis. (17 minutes)
Service Objects
Episode #398Dec 18, 2012114 comments

Service Objects

Models can quickly become a grab-bag of unrelated methods if behavior is constantly being pushed from the controller. Here I show how to refactor this using Concerns and Service Objects. (12 minutes)
Action View Walkthrough
Episode #397Dec 09, 201275 comments

Action View Walkthrough

Find out exactly what Rails is doing under the hood when it renders a view template for a response. What object context handles the template? How does the lookup process work? That and more covered in this code walkthrough. (15 minutes)
Action Controller Walkthrough
Episode #395Dec 02, 201277 comments

Action Controller Walkthrough

Do you ever wonder what goes on behind the scenes when a Rails controller handles a request? What do the "render" and "redirect_to" methods do exactly? This and more covered as we walk through the code of ActionController::Base. (11 minutes)
STI and Polymorphic Associations
Episode #394Nov 25, 201281 comments

STI and Polymorphic Associations

Single Table Inheritance (STI) can help organize branching logic into separate classes, but a polymorphic association may be a better fit if there are unique database columns. (14 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)
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)
Multitenancy with PostgreSQL
Episode #389Oct 27, 2012112 comments

Multitenancy with PostgreSQL

PostgreSQL Schemas can help create a multi-tenant app by keeping data separate at the database layer. Integrating with migrations can be tricky though, so watch this episode for the full details. (11 minutes)
Multitenancy with Scopes
Episode #388Oct 20, 2012120 comments

Multitenancy with Scopes

A multi-tenant application can be difficult to implement because the data for each tenant must be completely separate. Here I show how to do this using subdomains and default scopes in Active Record. (12 minutes)
Authorization from Scratch Part 2
Episode #386Oct 11, 201297 comments

Authorization from Scratch Part 2

This finishes the series on building authorization from scratch by refactoring the permission logic into a DSL, restricting authorization with attributes, and combining with strong_parameters to protect params. (20 minutes)