Class: ActiveAdmin::Views::Menu
- Defined in:
- lib/active_admin/views/components/menu.rb
Overview
Renders an ActiveAdmin::Menu as a set of unordered list items.
This component takes cares of deciding which items should be displayed given the current context and renders them appropriately.
The entire component is rendered within one ul element.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#menu ⇒ Object
readonly
Returns the value of attribute menu.
Instance Method Summary collapse
Instance Attribute Details
#menu ⇒ Object (readonly)
Returns the value of attribute menu.
12 13 14 |
# File 'lib/active_admin/views/components/menu.rb', line 12 def @menu end |
Instance Method Details
#build(menu, options = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/active_admin/views/components/menu.rb', line 18 def build(, = {}) @menu = super() .items.each do |item| (item) if helpers.render_in_context self, item.should_display end children.sort! end |
#tag_name ⇒ Object
28 29 30 |
# File 'lib/active_admin/views/components/menu.rb', line 28 def tag_name "ul" end |