lib/active_admin/dashboards.rb in activeadmin-0.3.4 vs lib/active_admin/dashboards.rb in activeadmin-0.4.0
- old
+ new
@@ -24,9 +24,13 @@
module_eval(&block)
end
# Add a new dashboard section to a namespace. If no namespace is given
# it will be added to the default namespace.
+ #
+ # Options include:
+ # :namespace => only display for specified namespace.
+ # :if => specify a method or block to determine whether the section is rendered at run time.
def add_section(name, options = {}, &block)
namespace = options.delete(:namespace) || ActiveAdmin.application.default_namespace || :root
self.sections[namespace] ||= []
self.sections[namespace] << Section.new(namespace, name, options, &block)
self.sections[namespace].sort!