module Enjoy::Catalog::Controllers::Categories
Public Instance Methods
index()
click to toggle source
# File lib/enjoy/catalog/controllers/categories.rb, line 12 def index @categories = category_class.enabled.sorted.to_a @root_catalog = category_class.enabled.roots.sorted.all.to_a # index_crumbs end
page_title()
click to toggle source
Calls superclass method
# File lib/enjoy/catalog/controllers/categories.rb, line 38 def page_title if @category @category.page_title else super end end
show()
click to toggle source
# File lib/enjoy/catalog/controllers/categories.rb, line 18 def show @category = category_class.enabled.find(params[:id]) if !@category.text_slug.blank? and @category.text_slug != params[:id] redirect_to @category, status_code: 301 return end @seo_parent_page = find_seo_page(url_for(action: :index)) @children = @category.children.enabled.sorted.all.to_a @items = @category.items.enabled.sorted.all.to_a if Enjoy::Catalog.config.breadcrumbs_on_rails_support add_breadcrumb @category.name, url_for(@category), if: :insert_breadcrumbs end # index_crumbs # category_crumbs end
Private Instance Methods
category_class()
click to toggle source
# File lib/enjoy/catalog/controllers/categories.rb, line 47 def category_class Enjoy::Catalog::Category end
item_class()
click to toggle source
# File lib/enjoy/catalog/controllers/categories.rb, line 50 def item_class Enjoy::Catalog::Item end