RailsCasts Pro episodes are now free!

Learn more or hide this

Applied Filters: complex xRefactoring x
Form Objects
Episode #416Jun 03, 2013335 comments

Form Objects

Models have a tendency to become a complex mess as an application grows. In this episode you will learn a couple of techniques to extract form-behavior out into its own class. (18 minutes)
Presenters from Scratch
Episode #287Oct 03, 2011122 comments

Presenters from Scratch

Clean up complex view logic with the help of presenters, and doing this from scratch gives you a lot of flexibility. Here I show not only how to create presenters, but how to test them using Test Unit and RSpec. (14 minutes)
Draper
Episode #286Oct 03, 201171 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)
Complex Partials
Episode #99Mar 31, 200830 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 Out Helper Object
Episode #101Apr 14, 200844 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)