Class: Megatron::TabHelper::Tabs
- Defined in:
- app/helpers/megatron/tab_helper.rb
Direct Known Subclasses
Instance Method Summary collapse
- #display(body) ⇒ Object
- #tab(text, href, options = {}, &block) ⇒ Object
- #tab_button(text, href) ⇒ Object
Methods inherited from Helper
Instance Method Details
permalink #display(body) ⇒ Object
[View source]
22 23 24 |
# File 'app/helpers/megatron/tab_helper.rb', line 22 def display(body) content_tag(:nav, class: 'tabs') { body } end |
permalink #tab(text, href, options = {}, &block) ⇒ Object
[View source]
4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/megatron/tab_helper.rb', line 4 def tab(text, href, = {}, &block) [:class] = add_class([:class], "tab") if block link_up href, , &block else link_up href, do text end end end |
permalink #tab_button(text, href) ⇒ Object
[View source]
16 17 18 19 20 |
# File 'app/helpers/megatron/tab_helper.rb', line 16 def (text, href) content_tag :a, class: %w{tab-btn btn medium}, href: href do text end end |