Class: Blog::PostCategoriesController

Inherits:
Spree::BaseController
  • Object
show all
Defined in:
app/controllers/blog/post_categories_controller.rb

Instance Method Summary collapse

Instance Method Details

#get_sidebarObject



13
14
15
16
17
# File 'app/controllers/blog/post_categories_controller.rb', line 13

def get_sidebar    
  @archive_posts = Post.live.limit(10)
  @post_categories = PostCategory.all
  get_tags
end

#get_tagsObject



19
20
21
# File 'app/controllers/blog/post_categories_controller.rb', line 19

def get_tags
  @tags = Post.live.tag_counts.order('count DESC').limit(25)
end

#showObject



7
8
9
10
11
# File 'app/controllers/blog/post_categories_controller.rb', line 7

def show
  @category = PostCategory.find_by_permalink(params[:id])
  @posts = @category.posts.live
  @posts = @posts.page(params[:page]).per(Post.per_page)
end