Class: UI::AlertDialogDescription

Inherits:
Phlex::HTML
  • Object
show all
Includes:
AlertDialogDescriptionBehavior
Defined in:
app/components/ui/alert_dialog_description.rb

Overview

Description - Phlex implementation

Description text for the alert dialog. Uses AlertDialogDescriptionBehavior module for shared styling logic.

Examples:

Basic usage

render UI::Description.new { "This action cannot be undone." }

Instance Method Summary collapse

Methods included from AlertDialogDescriptionBehavior

#alert_dialog_description_base_classes, #alert_dialog_description_classes, #alert_dialog_description_html_attributes

Constructor Details

#initialize(classes: "", **attributes) ⇒ AlertDialogDescription

Returns a new instance of AlertDialogDescription.

Parameters:

  • classes (String) (defaults to: "")

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



15
16
17
18
# File 'app/components/ui/alert_dialog_description.rb', line 15

def initialize(classes: "", **attributes)
  @classes = classes
  @attributes = attributes
end

Instance Method Details

#view_template(&block) ⇒ Object



20
21
22
23
24
# File 'app/components/ui/alert_dialog_description.rb', line 20

def view_template(&block)
  p(**alert_dialog_description_html_attributes) do
    yield if block_given?
  end
end