Class: Avo::Resources::Controls::DetachButton

Inherits:
BaseControl
  • Object
show all
Defined in:
lib/avo/resources/controls/detach_button.rb

Instance Attribute Summary

Attributes inherited from BaseControl

#as_index_control, #color, #confirmation_message, #icon, #icon_class, #label, #size, #style, #title

Instance Method Summary collapse

Methods inherited from BaseControl

#type

Constructor Details

#initialize(**args) ⇒ DetachButton

Returns a new instance of DetachButton.



5
6
7
8
9
10
11
12
# File 'lib/avo/resources/controls/detach_button.rb', line 5

def initialize(**args)
  super(**args)

  if args[:item].present?
    @title = I18n.t("avo.detach_item", item: args[:item]).humanize if title.nil?
    @confirmation_message = I18n.t("avo.are_you_sure_detach_item", item: args[:item]) if confirmation_message.nil?
  end
end