Module: ActiveAdmin::Resource::Sidebars
- Included in:
- Page, ActiveAdmin::Resource
- Defined in:
- lib/active_admin/resource/sidebars.rb
Instance Method Summary collapse
- #add_sidebar_section(name, options) ⇒ Object
- #clear_sidebar_sections! ⇒ Object
- #sidebar_sections ⇒ Object
- #sidebar_sections? ⇒ Boolean
- #sidebar_sections_for(action, render_context = nil) ⇒ Object
Instance Method Details
#add_sidebar_section(name, options) ⇒ Object
8 9 10 |
# File 'lib/active_admin/resource/sidebars.rb', line 8 def (name, ) << SidebarSection.new(name, ) end |
#clear_sidebar_sections! ⇒ Object
16 17 18 |
# File 'lib/active_admin/resource/sidebars.rb', line 16 def @sidebar_sections = [] end |
#sidebar_sections ⇒ Object
12 13 14 |
# File 'lib/active_admin/resource/sidebars.rb', line 12 def @sidebar_sections ||= [] end |
#sidebar_sections? ⇒ Boolean
25 26 27 |
# File 'lib/active_admin/resource/sidebars.rb', line 25 def !!@sidebar_sections && @sidebar_sections.any? end |
#sidebar_sections_for(action, render_context = nil) ⇒ Object
20 21 22 23 |
# File 'lib/active_admin/resource/sidebars.rb', line 20 def (action, render_context = nil) .select{|section| section.display_on?(action, render_context) } .sort_by(&:priority) end |