Sha256: 3f93e53cdd0c184dd021f1b71a127eb41c6bfa2aaea31a74eab3df3541504b02
Contents?: true
Size: 862 Bytes
Versions: 4
Compression:
Stored size: 862 Bytes
Contents
require 'active_admin/helpers/optional_display' module ActiveAdmin class Resource module Sidebars def initialize(*args) super add_default_sidebar_sections end def sidebar_sections @sidebar_sections ||= [] end def clear_sidebar_sections! @sidebar_sections = [] end def sidebar_sections_for(action, render_context = nil) sidebar_sections.select{|section| section.display_on?(action, render_context) } end def sidebar_sections? !!@sidebar_sections && @sidebar_sections.any? end private def add_default_sidebar_sections self.sidebar_sections << ActiveAdmin::SidebarSection.new(:filters, :only => :index) do active_admin_filters_form_for assigns["search"], filters_config end end end end end
Version data entries
4 entries across 4 versions & 1 rubygems