Class: Zencms::PostsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/zencms/posts_controller.rb

Instance Method Summary collapse

Instance Method Details

#archiveObject



23
24
25
26
# File 'app/controllers/zencms/posts_controller.rb', line 23

def archive
  @posts ||= end_of_association_chain.from_month(Time.parse "#{params[:month]}/#{params[:year]}").published
  render :action => 'index'
end

#categoryObject



11
12
13
14
15
# File 'app/controllers/zencms/posts_controller.rb', line 11

def category
  @category = ActsAsTaggableOn::Tag.friendly.find(params[:category])
  @posts ||= end_of_association_chain.tagged_with(@category, on: :categories)
  render :action => 'index'
end

#tagObject



17
18
19
20
21
# File 'app/controllers/zencms/posts_controller.rb', line 17

def tag
  @tag = ActsAsTaggableOn::Tag.friendly.find(params[:tag])
  @posts ||= end_of_association_chain.tagged_with(@tag, on: :tags)
  render :action => 'index'
end