class ActiveAdmin::Views::Tabs

Public Instance Methods

build(&block) click to toggle source
# File lib/active_admin/views/components/tabs.rb, line 12
def build(&block)
  @menu = ul(class: 'nav nav-tabs', role: "tablist")
  @tabs_content = div(class: 'tab-content')
end
build_content_item(title, options, &block) click to toggle source
# File lib/active_admin/views/components/tabs.rb, line 22
def build_content_item(title, options, &block)
  options = options.reverse_merge(id: title.parameterize)
  div(options, &block)
end
build_menu_item(title, options, &block) click to toggle source
# File lib/active_admin/views/components/tabs.rb, line 17
def build_menu_item(title, options, &block)
  options = options.reverse_merge({})
  li { link_to title, "##{title.parameterize}", options }
end
tab(title, options = {}, &block) click to toggle source
# File lib/active_admin/views/components/tabs.rb, line 6
def tab(title, options = {}, &block)
  title = title.to_s.titleize if title.is_a? Symbol
  @menu << build_menu_item(title, options, &block)
  @tabs_content << build_content_item(title, options, &block)
end