lib/avo/resources/controls/edit_button.rb in avo-2.53.0 vs lib/avo/resources/controls/edit_button.rb in avo-3.0.0.beta1
- old
+ new
@@ -3,10 +3,13 @@
module Controls
class EditButton < BaseControl
def initialize(**args)
super(**args)
- @label = I18n.t("avo.edit").capitalize
+ @label = args[:label] || I18n.t("avo.edit").capitalize
+ if args[:item].present?
+ @title = I18n.t("avo.edit_item", item: args[:item]).humanize if title.nil?
+ end
end
end
end
end
end