ApplicationController.class_eval do before_filter :populate_sidebars protected def populate_sidebars @sidebar_modules = {:left => {}, :right => {}} Refinery::Blog::Category.all.each do |c| mod = [] c.posts.limit(5).each do |post| mod << SidebarPostDecorator.new(post) end @sidebar_modules[:left][c.title] = mod end end end