Class: PhlexKit::AlertDialogCancel

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/alert_dialog/alert_dialog_cancel.rb

Overview

The dismiss button in a PhlexKit::AlertDialog footer — an outline PhlexKit::Button wired to the controller's #dismiss (removes the modal). See alert_dialog.rb.

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ AlertDialogCancel

Returns a new instance of AlertDialogCancel.



5
6
7
# File 'app/components/phlex_kit/alert_dialog/alert_dialog_cancel.rb', line 5

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



9
10
11
# File 'app/components/phlex_kit/alert_dialog/alert_dialog_cancel.rb', line 9

def view_template(&block)
  render PhlexKit::Button.new(variant: :outline, **mix({ data: { action: "click->phlex-kit--alert-dialog#dismiss" } }, @attrs), &block)
end