Module: Godmin::Helpers::BatchActions

Defined in:
lib/godmin/helpers/batch_actions.rb

Instance Method Summary collapse

Instance Method Details



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/godmin/helpers/batch_actions.rb', line 4

def batch_action_link(name, options)
  return unless @resource_service.include_batch_action?(name)

  link_to(
    translate_scoped("batch_actions.labels.#{name}", default: name.to_s.titleize),
    [*@resource_parents, @resource_class],
    method: :patch,
    class: "btn btn-default hidden",
    data: {
      behavior: "batch-actions-action-link",
      confirm: options[:confirm] ? translate_scoped("batch_actions.confirm_message") : false,
      value: name
    }
  )
end