Module: ActiveAdmin::Resource::Sidebars

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

Instance Method Summary collapse

Instance Method Details

#clear_sidebar_sections!Object



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

def clear_sidebar_sections!
  @sidebar_sections = []
end


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

def sidebar_sections
  @sidebar_sections ||= []
end

Returns:

  • (Boolean)


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

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


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

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