Class: ActiveAdmin::Views::Scopes
- Includes:
- ScopeChain
- Defined in:
- lib/active_admin/views/components/scopes.rb
Overview
Renders a collection of ActiveAdmin::Scope objects as a simple list with a separator
Instance Method Summary collapse
Instance Method Details
#build(scopes, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_admin/views/components/scopes.rb', line 16 def build(scopes, = {}) super({ role: "toolbar" }) add_class "scopes" prepare_async_counts(scopes, ) scopes.group_by(&:group).each do |group, group_scopes| div class: "index-button-group", role: "group", data: { "group": group_name(group) } do group_scopes.each do |scope| build_scope(scope, ) if display_scope?(scope) end nil end end end |
#tag_name ⇒ Object
12 13 14 |
# File 'lib/active_admin/views/components/scopes.rb', line 12 def tag_name "div" end |