Class: Rcms::TidingsController

Inherits:
ApplicationController show all
Defined in:
lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb

Instance Method Summary collapse

Methods included from ApplicationController

included

Instance Method Details

#indexObject



2
3
4
5
# File 'lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb', line 2

def index
  @resources = Rcms::Tiding.frontend.page(params[:page]).per(10)
  apply_meta_tags title: t('rcms.tiding.index_title')
end

#retrieve(slug_or_id) ⇒ Object



12
13
14
15
# File 'lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb', line 12

def retrieve slug_or_id
  Rcms::Tiding.find slug_or_id
rescue
end

#showObject



7
8
9
10
# File 'lib/generators/templates_tidings/app/controllers/rcms/tidings_controller.rb', line 7

def show
  @resource = retrieve params[:id]
  apply_meta_tags @resource
end