Module: ActiveAdmin::ResourceController::Sidebars::ClassMethods

Defined in:
lib/active_admin/resource_controller/sidebars.rb

Instance Method Summary collapse

Instance Method Details

#clear_sidebar_sections!Object



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

def clear_sidebar_sections!
  self.sidebar_sections = []
end


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

def sidebar(name, options = {}, &block)
  self.sidebar_sections << ActiveAdmin::Sidebar::Section.new(name, options, &block)
end


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

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