diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2013-12-24 14:15:45 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2013-12-24 14:15:45 +0100 |
commit | 771532124d5486eb78c22f1c638ff647883d46b8 (patch) | |
tree | 7f86c54097030021f0870fa39e833abc2e6f2739 /app/decorators/controllers | |
parent | c4e6ef89054b88b6d59f8bf9b6d67ab990cb7906 (diff) | |
download | hmnoweb-771532124d5486eb78c22f1c638ff647883d46b8.tar.gz hmnoweb-771532124d5486eb78c22f1c638ff647883d46b8.tar.bz2 hmnoweb-771532124d5486eb78c22f1c638ff647883d46b8.zip |
Populate home page with blog entries.
I would like to just render the refinery/blog/index template for
this, but I did not find a way to do it, so I copied it instead. May
need to revisit this if upgrading to a new refinery or blog engine.
Diffstat (limited to 'app/decorators/controllers')
-rw-r--r-- | app/decorators/controllers/refinery/pages_controller_decorator.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/decorators/controllers/refinery/pages_controller_decorator.rb b/app/decorators/controllers/refinery/pages_controller_decorator.rb index da020da..034939c 100644 --- a/app/decorators/controllers/refinery/pages_controller_decorator.rb +++ b/app/decorators/controllers/refinery/pages_controller_decorator.rb @@ -1,6 +1,8 @@ ApplicationController.class_eval do + include Refinery::Blog::ControllerHelper before_filter :populate_sidebars + before_filter :populate_home_page, :only => [:home] protected @@ -20,4 +22,14 @@ ApplicationController.class_eval do end end end + + def populate_home_page + # + # These methods are included from Refinery::Blog::ControllerHelper + # Makes sure everyting is in place for the home page view template. + # + find_all_blog_posts + find_all_blog_categories + find_tags + end end |