aboutsummaryrefslogtreecommitdiffstats
path: root/app/decorators
diff options
context:
space:
mode:
Diffstat (limited to 'app/decorators')
-rw-r--r--app/decorators/controllers/refinery/pages_controller_decorator.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/decorators/controllers/refinery/pages_controller_decorator.rb b/app/decorators/controllers/refinery/pages_controller_decorator.rb
new file mode 100644
index 0000000..d86fe39
--- /dev/null
+++ b/app/decorators/controllers/refinery/pages_controller_decorator.rb
@@ -0,0 +1,14 @@
+ApplicationController.class_eval do
+
+ before_filter :populate_sidebars
+
+ protected
+
+ def populate_sidebars
+ categories = Refinery::Blog::Category.all
+ @sidebar_contents = {}
+ categories.each do |c|
+ @sidebar_contents[c.title] = c.posts.limit(10)
+ end
+ end
+end