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
# File 'app/controllers/refinery/news/items_controller.rb', line 16

def archive
  if params[:month].present?
    @archive_for_month = true
    @archive_date = Time.parse("#{params[:month]}/#{params[:year]}")
    @items = Item.archived.translated.by_archive(@archive_date).page(params[:page])
  else
    @archive_date = Time.parse("01/#{params[:year]}")
    @items = Item.archived.translated.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