module Enjoy::News::Controllers::Categories
Public Instance Methods
index()
click to toggle source
# File lib/enjoy/news/controllers/categories.rb, line 6 def index @categories = category_class.enabled.sorted.to_a @root_catalog = category_class.enabled.roots.sorted.all.to_a after_initialize end
page_title()
click to toggle source
Calls superclass method
# File lib/enjoy/news/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/news/controllers/categories.rb, line 13 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 @news = @category.news.enabled.sorted.all.to_a after_initialize end
Private Instance Methods
after_initialize()
click to toggle source
# File lib/enjoy/news/controllers/categories.rb, line 43 def after_initialize end
category_class()
click to toggle source
# File lib/enjoy/news/controllers/categories.rb, line 36 def category_class Enjoy::News::Category end
news_class()
click to toggle source
# File lib/enjoy/news/controllers/categories.rb, line 39 def news_class Enjoy::News::News end