Class: Integral::TagsController

Inherits:
BlogController show all
Defined in:
app/controllers/integral/tags_controller.rb

Overview

Front end tags controller

Instance Method Summary collapse

Instance Method Details

#indexObject

GET / List blog tags



10
11
12
13
# File 'app/controllers/integral/tags_controller.rb', line 10

def index
  add_breadcrumb t('integral.breadcrumbs.tags'), nil
  @tags = Integral::Post.tag_counts_on("published_#{I18n.locale}", order: 'taggings_count desc').paginate(page: params[:page])
end

#showObject

GET /:id Presents blog tags



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/controllers/integral/tags_controller.rb', line 17

def show
  add_breadcrumb t('integral.breadcrumbs.tags'), integral.tags_url
  add_breadcrumb @resource.name, nil

  page_title = "Posts tagged with #{@resource.name}"
  page_title += " - Page #{params[:page]}" if params[:page].present?
  page_description = params[:page].present? ? "Page #{params[:page] } - #{t('integral.tags.show.description', tag_name: @resource.name)}" : t('integral.tags.show.description', tag_name: @resource.name)

  @meta_data = {
    page_title: page_title,
    page_description: page_description
  }
end