class ActiveAdmin::Views::TabbedNavigation
The entire component is rendered within one ul element.
displayed given the current context and renders them appropriately.
This component takes cares of deciding which items should be
Renders an ActiveAdmin::Menu as a set of unordered list items.
def build(menu, options = {})
-
options
(Hash
) -- the options as passed to the underlying ul element. -
menu
(ActiveAdmin::Menu
) -- the Menu to render
def build(menu, options = {}) @menu = menu super(default_options.merge(options)) build_menu end
def build_menu
def build_menu menu_items.each do |item| build_menu_item(item) end end
def build_menu_item(item)
def build_menu_item(item) li id: item.id do |li| li.add_class "current" if item.current? assigns[:current_tab] if url = item.url(self) text_node link_to item.label(self), url, item.html_options else span item.label(self), item.html_options end if children = item.items(self).presence li.add_class "has_nested" ul do children.each{ |child| build_menu_item child } end end end end
def default_options
def default_options { id: "tabs" } end
def menu_items
def menu_items menu.items(self) end
def tag_name
def tag_name 'ul' end