Class: Megatron::NavigationHelper::Nav

Inherits:
Helper
  • Object
show all
Defined in:
app/helpers/megatron/navigation_helper.rb

Direct Known Subclasses

PrimaryNav, SecondaryNav

Instance Method Summary collapse

Methods inherited from Helper

inherited

Instance Method Details

#icon_label(text) ⇒ Object



23
24
25
# File 'app/helpers/megatron/navigation_helper.rb', line 23

def icon_label(text)
  (:span, class: 'icon_label') { text }
end

#item(text, href, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'app/helpers/megatron/navigation_helper.rb', line 4

def item(text, href, options = {})
  options[:class] = add_class(options[:class], "#{nav_class}-item")
  nav_icon = options.delete(:icon)

  link_up href, options do
    concat nav_icon(nav_icon) unless nav_icon.nil?
    concat ' '
    if options[:link_label] == false
      concat icon_label(text)
    else
      concat link_label(text)
    end
  end
end


19
20
21
# File 'app/helpers/megatron/navigation_helper.rb', line 19

def link_label(text)
  (:span, class: 'link_label icon_label') { text }
end