Class: ActiveAdmin::BatchActions::BatchActionPopover

Inherits:
Views::ActionListPopover show all
Defined in:
lib/active_admin/batch_actions/views/batch_action_popover.rb

Overview

Build an BatchActionPopover

Instance Method Summary collapse

Methods inherited from Views::Popover

#add_child

Instance Method Details

#action(batch_action, options = {}) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/active_admin/batch_actions/views/batch_action_popover.rb', line 14

def action(batch_action, options = {})
  options[:class] ||= []
  options[:class] += %w(batch_action)
  options.merge! "data-action" => batch_action.sym,
                 "data-confirm" => batch_action.confirm

  title = I18n.t("active_admin.batch_actions.labels.#{batch_action.sym}", :default => batch_action.title)
  label = I18n.t("active_admin.batch_actions.action_label", :title => title)

  super(label, "#", options)
end

#build(options = {}, &block) ⇒ Object



9
10
11
12
# File 'lib/active_admin/batch_actions/views/batch_action_popover.rb', line 9

def build(options = {}, &block)
  options[:id] ||= "batch_actions_popover"
  super(options)
end