Class: Megatron::TabHelper::Tabs

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

Direct Known Subclasses

BoxTabs

Instance Method Summary collapse

Instance Method Details

#display(body) ⇒ Object



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

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

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



4
5
6
7
8
9
10
# File 'app/helpers/megatron/tab_helper.rb', line 4

def tab(text, href, options = {})
  options[:class] = add_class(options[:class], "tab")
  options[:class] = add_class(options[:class], "here") if test_current_page(options[:here_if])
   :a, class: options[:class], href: href do
    text
  end
end

#tab_button(text, href) ⇒ Object



12
13
14
15
16
# File 'app/helpers/megatron/tab_helper.rb', line 12

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