Class: Megatron::TabHelper::Tabs

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

Direct Known Subclasses

BoxTabs

Instance Method Summary collapse

Methods inherited from Helper

inherited

Instance Method Details

#display(body) ⇒ Object

[View source]

22
23
24
# File 'app/helpers/megatron/tab_helper.rb', line 22

def display(body)
  (:nav, class: 'tabs') { body }
end

#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, options = {}, &block)
  options[:class] = add_class(options[:class], "tab")

  if block
    link_up href, options, &block
  else
    link_up href, options do
      text
    end
  end
end

#tab_button(text, href) ⇒ Object

[View source]

16
17
18
19
20
# File 'app/helpers/megatron/tab_helper.rb', line 16

def tab_button(text, href)
   :a, class: %w{tab-btn btn medium}, href: href do
    text
  end
end