RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: Free Episodes xRefactoring x
Draper
Episode #286 – Oct 03, 2011 – 71 comments

Draper

Clean up complex view logic using Draper. This gem provides decorators (much like presenters) which bundles view logic in an object oriented fashion. In this episode I do a step-by-step refactoring of a complex template into a decorator. (12 minutes)
How I Test
Episode #275 – Jul 18, 2011 – 137 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)
Refactoring & Dynamic Delegator
Episode #212 – May 03, 2010 – 50 comments

Refactoring & Dynamic Delegator

Learn how to refactor a set of conditional Active Record queries using a Dynamic Delegator. (7 minutes)
Site Wide Announcements
Episode #103 – Apr 28, 2008 – 58 comments

Site Wide Announcements

Sometimes you need to display an administrative announcement to every page on the site and give the users the ability to hide the announcement. See how in this episode. (13 minutes)
Refactoring Out Helper Object
Episode #101 – Apr 14, 2008 – 44 comments

Refactoring Out Helper Object

If you have complex view logic, this can easily lead to helper methods which call each other. See how to refactor this out into another object in this episode. This is also known as the presenter pattern. (7 minutes)
Complex Partials
Episode #99 – Mar 31, 2008 – 30 comments

Complex Partials

How do you handle partials which have differences depending on the action which is rendering them? Here's three suggestions for this problem. (8 minutes)
Refactoring Long Methods
Episode #91 – Feb 03, 2008 – 50 comments

Refactoring Long Methods

In this episode I walk you through an exercise in refactoring by taking a long method and making it more concise. (7 minutes)
Cleaning Up the View
Episode #55 – Jul 09, 2007 – 53 comments

Cleaning Up the View

This episode starts off with a big, messy template. Watch as this code shrinks and becomes more readable while the interface stays the same. (9 minutes)
Pretty Page Title
Episode #30 – May 11, 2007 – 66 comments

Pretty Page Title

If you are like me, you avoid creating page titles because it is kind of a pain. But in this episode I will show you a clean way to add titles to your pages. (5 minutes)
Refactoring User Name Part 3
Episode #12 – Mar 30, 2007 – 64 comments

Refactoring User Name Part 3

In the final part of this series you will see how to refactor your tests. Keeping tests clean is important because it will make testing easier to do in the future. (4 minutes)