Module: Enjoy::Faq::Controllers::Categories

Extended by:
ActiveSupport::Concern
Included in:
Enjoy::Faq::CategoriesController
Defined in:
lib/enjoy/faq/controllers/categories.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
# 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_titleObject



27
28
29
30
31
32
33
# File 'lib/enjoy/faq/controllers/categories.rb', line 27

def page_title
  if @category
    @category.page_title
  else
    super
  end
end

#showObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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