module AckRocketCmsCatalog::Controllers::ItemCategories

Public Instance Methods

index() click to toggle source
# File lib/ack_rocket_cms_catalog/controllers/item_categories.rb, line 6
def index
  @item_categories = item_category_class.enabled.sorted.to_a
  @root_catalog = item_category_class.enabled.roots.sorted.all.to_a
  # index_crumbs
end
page_title() click to toggle source
Calls superclass method
# File lib/ack_rocket_cms_catalog/controllers/item_categories.rb, line 27
def page_title
  if @item_category
    @item_category.page_title
  else
    super
  end
end
show() click to toggle source
# File lib/ack_rocket_cms_catalog/controllers/item_categories.rb, line 12
def show
  @item_category = item_category_class.enabled.find(params[:id])
  if !@item_category.text_slug.blank? and @item_category.text_slug != params[:id]
    redirect_to @item_category, status_code: 301
    return
  end
  @seo_parent_page = find_seo_page(item_categories_path)
  
  @children = @item_category.children.enabled.sorted.all.to_a
  @items = @item_category.items.enabled.sorted.all.to_a

  # index_crumbs
  # category_crumbs
end

Private Instance Methods

item_category_class() click to toggle source
# File lib/ack_rocket_cms_catalog/controllers/item_categories.rb, line 36
def item_category_class
  ItemCategory
end
item_class() click to toggle source
# File lib/ack_rocket_cms_catalog/controllers/item_categories.rb, line 39
def item_class
  Item
end