RailsCasts Pro episodes are now free!

Learn more or hide this

Rob Yurkowski's Profile

GitHub User: robyurkowski

Site: http://rob.yurkowski.net

Comments by Rob Yurkowski

Avatar

The best way to do it is to use a decorator as Ryan has done with the authenticate method. To wit:

ruby
Refinery::PagesController.class_eval_do
  before_filter :find_pianos, :only => [:home]

  def find_pianos
    @pianos = ::Refinery::Pianos::Piano.all
  end
  private :find_pianos
end