Class: Refinery::News::ItemsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/refinery/news/items_controller.rb

Instance Method Summary collapse

Instance Method Details

#archiveObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/refinery/news/items_controller.rb', line 16

def archive
  if params[:month].present?
    date = "#{params[:month]}/#{params[:year]}"
    @archive_date = Time.parse(date)
    @date_title = @archive_date.strftime('%B %Y')
    @items = Refinery::News::Item.live.by_archive(@archive_date).page(params[:page])
  else
    date = "01/#{params[:year]}"
    @archive_date = Time.parse(date)
    @date_title = @archive_date.strftime('%Y')
    @items = Refinery::News::Item.live.by_year(@archive_date).page(params[:page])
  end
end

#indexObject



8
9
10
# File 'app/controllers/refinery/news/items_controller.rb', line 8

def index
  # render 'index'
end

#showObject



12
13
14
# File 'app/controllers/refinery/news/items_controller.rb', line 12

def show
  # render 'show'
end