Class: ActiveAdmin::Views::SidebarSection

Inherits:
Panel show all
Defined in:
lib/active_admin/views/components/sidebar_section.rb

Instance Method Summary collapse

Methods inherited from Panel

#add_child

Methods inherited from Component

#default_class_name, #initialize, #tag_name

Constructor Details

This class inherits a constructor from ActiveAdmin::Component

Instance Method Details

#build(section) ⇒ Object

Takes a ActiveAdmin::Sidebar::Section instance



8
9
10
11
12
13
# File 'lib/active_admin/views/components/sidebar_section.rb', line 8

def build(section)
  @section = section
  super(@section.title, :icon => @section.icon)
  self.id = @section.id
  build_sidebar_content
end

#build_sidebar_contentObject (protected)



17
18
19
20
21
22
23
24
# File 'lib/active_admin/views/components/sidebar_section.rb', line 17

def build_sidebar_content
  if @section.block
    rvalue = instance_eval(&@section.block)
    self << rvalue if rvalue.is_a?(String)
  else
    text_node render(@section.partial_name)
  end
end