Module: ActiveAdmin::Resource::Sidebars

Included in:
ActiveAdmin::Resource
Defined in:
lib/active_admin/resource/sidebars.rb

Instance Method Summary collapse

Instance Method Details

#clear_sidebar_sections!Object



17
18
19
# File 'lib/active_admin/resource/sidebars.rb', line 17

def clear_sidebar_sections!
  @sidebar_sections = []
end

#initialize(*args) ⇒ Object



8
9
10
11
# File 'lib/active_admin/resource/sidebars.rb', line 8

def initialize(*args)
  super
  add_default_sidebar_sections
end


13
14
15
# File 'lib/active_admin/resource/sidebars.rb', line 13

def sidebar_sections
  @sidebar_sections ||= []
end


21
22
23
# File 'lib/active_admin/resource/sidebars.rb', line 21

def sidebar_sections_for(action)
  sidebar_sections.select{|section| section.display_on?(action) }
end