module Enjoy::Faq::Controllers::Categories

Public Instance Methods

index() click to toggle source
# File lib/enjoy/faq/controllers/categories.rb, line 6
def index
  @categories = category_class.enabled.sorted.to_a
  @root_categories = category_class.enabled.roots.sorted.all.to_a
  # index_crumbs
end
page_title() click to toggle source
Calls superclass method
# File lib/enjoy/faq/controllers/categories.rb, line 27
def page_title
  if @category
    @category.page_title
  else
    super
  end
end
show() click to toggle source
# File lib/enjoy/faq/controllers/categories.rb, line 12
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(question_categories_path)

  @children = @category.children.enabled.sorted.all.to_a
  @questions = @category.questions.enabled.sorted.all.to_a

  # index_crumbs
  # category_crumbs
end

Private Instance Methods

category_class() click to toggle source
# File lib/enjoy/faq/controllers/categories.rb, line 36
def category_class
  Enjoy::Faq::Category
end
question_class() click to toggle source
# File lib/enjoy/faq/controllers/categories.rb, line 39
def question_class
  Enjoy::Faq::Question
end