Module: ActiveAdmin::Resource::Sidebars
- Included in:
- Page, ActiveAdmin::Resource
- Defined in:
- lib/active_admin/resource/sidebars.rb
Instance Method Summary collapse
- #clear_sidebar_sections! ⇒ Object
- #sidebar_sections ⇒ Object
- #sidebar_sections? ⇒ Boolean
- #sidebar_sections_for(action, render_context = nil) ⇒ Object
Instance Method Details
#clear_sidebar_sections! ⇒ Object
13 14 15 |
# File 'lib/active_admin/resource/sidebars.rb', line 13 def @sidebar_sections = [] end |
#sidebar_sections ⇒ Object
9 10 11 |
# File 'lib/active_admin/resource/sidebars.rb', line 9 def @sidebar_sections ||= [] end |
#sidebar_sections? ⇒ Boolean
22 23 24 |
# File 'lib/active_admin/resource/sidebars.rb', line 22 def !!@sidebar_sections && @sidebar_sections.any? end |
#sidebar_sections_for(action, render_context = nil) ⇒ Object
17 18 19 20 |
# File 'lib/active_admin/resource/sidebars.rb', line 17 def (action, render_context = nil) .select { |section| section.display_on?(action, render_context) } .sort_by(&:priority) end |