Module: ActiveAdmin::Resource::Sidebars

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) clear_sidebar_sections!



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

def clear_sidebar_sections!
  @sidebar_sections = []
end


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

def sidebar_sections
  @sidebar_sections ||= []
end


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

def sidebar_sections?
  !!@sidebar_sections && @sidebar_sections.any?
end


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

def sidebar_sections_for(action, render_context = nil)
  sidebar_sections.select{|section| section.display_on?(action, render_context) }
    .sort_by(&:priority)
end