Module: Enki::NavigationHelper

Included in:
ApplicationController
Defined in:
app/helpers/enki/navigation_helper.rb

Instance Method Summary collapse

Instance Method Details



10
11
12
13
14
# File 'app/helpers/enki/navigation_helper.rb', line 10

def category_links_for_navigation
  link = Struct.new(:name, :url)
  @popular_tags ||= Tag.find(:all).reject {|tag| tag.taggings.empty? }.sort_by {|tag| tag.taggings.size }.reverse
  @popular_tags.collect {|tag| link.new(tag.name, posts_path(:tag => tag.name)) }
end

#class_for_tab(tab_name, index) ⇒ Object



16
17
18
19
20
21
# File 'app/helpers/enki/navigation_helper.rb', line 16

def class_for_tab(tab_name, index)
  classes = []
  classes << 'current' if "admin/#{tab_name.downcase}" == params[:controller]
  classes << 'first'   if index == 0
  classes.join(' ')
end


3
4
5
6
7
8
# File 'app/helpers/enki/navigation_helper.rb', line 3

def page_links_for_navigation
  link = Struct.new(:name, :url)
  [link.new("Home", root_path),
   link.new("Archives", archives_path)] +
    Page.order('title').collect {|page| link.new(page.title, page_path(page.slug))}
end