Class: Integral::CategoriesController
- Inherits:
-
BlogController
- Object
- BlogController
- Integral::CategoriesController
- Defined in:
- app/controllers/integral/categories_controller.rb
Overview
Front end categories controller
Instance Method Summary collapse
-
#show ⇒ Object
GET /:id Presents all posts with particular category.
- #url_for(options = {}) ⇒ Object
Instance Method Details
#show ⇒ Object
GET /:id Presents all posts with particular category
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/integral/categories_controller.rb', line 11 def show @resource.title, nil page_title = params[:page].present? ? "#{@resource.title} - Page #{params[:page]}" : @resource.title page_description = params[:page].present? ? "#{@resource.description} - Page #{params[:page]}" : @resource.description @meta_data = { page_title: page_title, page_description: page_description, image: @resource.image_url(size: :large) } end |
#url_for(options = {}) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/integral/categories_controller.rb', line 25 def url_for(={}) if .is_a?(Hash) && .include?(:category_path) && [:category_path] == true "#{category_path(@resource)}?page=#{[:page]}" elsif .is_a?(Hash) && .empty? category_path(@resource) else super() end end |