Class: Megatron::NavigationHelper::Nav
- Inherits:
-
BlockHelpers::Base
- Object
- BlockHelpers::Base
- Megatron::NavigationHelper::Nav
- Defined in:
- app/helpers/megatron/navigation_helper.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#icon_label(text) ⇒ Object
23 24 25 |
# File 'app/helpers/megatron/navigation_helper.rb', line 23 def icon_label(text) content_tag(: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, = {}) [:class] = add_class([:class], "#{nav_class}-item") [:class] = add_class([:class], "here") if test_current_page([:here_if]) nav_icon = .delete(:icon) link_to href, do concat icon(nav_icon) concat ' ' if [:link_label] == false concat icon_label(text) else concat link_label(text) end end end |
#link_label(text) ⇒ Object
19 20 21 |
# File 'app/helpers/megatron/navigation_helper.rb', line 19 def link_label(text) content_tag(:span, class: 'link_label icon_label') { text } end |