Class: Integral::CategoriesController

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

Overview

Front end categories controller

Instance Method Summary collapse

Instance Method Details

#showObject

GET /:id Presents all posts with particular category



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/integral/categories_controller.rb', line 8

def show
  add_breadcrumb @resource.title, nil

  @meta_data = {
    page_title: @resource.title,
    page_description: @resource.description,
    image: @resource&.image&.url
  }

  @posts = Integral::Post.published.where(category_id: @resource.id).paginate(page: params[:page])
end