class RailsBootstrapTabs::Renderers::TabsBootstrap3Renderer

Public Instance Methods

render_pane(tab) { || ... } click to toggle source
# File lib/rails-bootstrap-tabs/renderers/tabs_bootstrap3_renderer.rb, line 27
def render_pane(tab)
  options = tab.options
  pane_class = 'tab-pane'
  pane_class << ' active' if options[:active]
  content_tag :div, id: options[:anchor].to_s, class: pane_class do
    yield
  end
end
render_panes_wrapper(options) { || ... } click to toggle source
# File lib/rails-bootstrap-tabs/renderers/tabs_bootstrap3_renderer.rb, line 18
def render_panes_wrapper(options)
  content_class = 'tab-content'
  content_class << " #{options[:content_class]}" if options[:content_class]

  content_tag :div, class: content_class do
    yield
  end
end
render_tab(tab) { || ... } click to toggle source
# File lib/rails-bootstrap-tabs/renderers/tabs_bootstrap3_renderer.rb, line 9
def render_tab(tab)
  options = tab.options
  content_tag :li, class: ('active' if options[:active]) do
    link_to "##{options[:anchor]}", class: (options[:link_class] if options[:link_class]), data: { toggle: 'tab' } do
      yield
    end
  end
end
render_tabs_wrapper() { || ... } click to toggle source
# File lib/rails-bootstrap-tabs/renderers/tabs_bootstrap3_renderer.rb, line 3
def render_tabs_wrapper
  content_tag :ul, class: 'nav nav-tabs' do
    yield
  end
end