Class: RubyUIAdmin::UI::ToastAction

Inherits:
Base
  • Object
show all
Defined in:
app/components/ruby_ui_admin/ui/toast_action.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary

Attributes inherited from Base

#attrs

Instance Method Summary collapse

Constructor Details

#initialize(label:, on: nil, **attrs) ⇒ ToastAction

Returns a new instance of ToastAction.



7
8
9
10
11
# File 'app/components/ruby_ui_admin/ui/toast_action.rb', line 7

def initialize(label:, on: nil, **attrs)
  @label = label
  @on = on
  super(**attrs)
end

Instance Method Details

#view_templateObject



13
14
15
# File 'app/components/ruby_ui_admin/ui/toast_action.rb', line 13

def view_template
  button(**attrs) { @label }
end