Class: Ecm::News::ItemsController

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

Instance Method Summary collapse

Instance Method Details

#indexObject



2
3
4
# File 'app/controllers/ecm/news/items_controller.rb', line 2

def index
  @items = Ecm::News::Item.published.where(locale: I18n.locale.to_s).order('published_at DESC').page(params[:page]).per(5)
end

#showObject



6
7
8
# File 'app/controllers/ecm/news/items_controller.rb', line 6

def show
  @item = Ecm::News::Item.published.where(locale: I18n.locale.to_s).friendly.find(params[:id])
end