blob: d93ae9df8e2b5d7a36b1ff9b613781e086280d3c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
ApplicationController.class_eval do
include Refinery::Blog::ControllerHelper
before_filter :populate_sidebars
before_filter :populate_home_page, :only => [:home]
protected
def populate_sidebars
@sidebar_modules = []
Refinery::Blog::Category.all.each do |c|
@sidebar_modules << SidebarBlogCategory.new(c)
end
#
# The blog categories and tags are listed in the right sidebar
# on every page.
#
find_all_blog_categories
find_tags
end
def populate_home_page
@posts = Refinery::Blog::Post
.live
.includes(:comments, :categories)
.where(:refinery_blog_categories => { :sidebar_position => 0 })
.page(params[:page])
end
end
|