Class: UI::AlertDescriptionComponent

Inherits:
ViewComponent::Base
  • Object
show all
Includes:
AlertDescriptionBehavior
Defined in:
app/view_components/ui/alert_description_component.rb

Overview

Alert Description - ViewComponent implementation

Description text for an alert component.

Instance Method Summary collapse

Methods included from AlertDescriptionBehavior

#alert_description_base_classes, #alert_description_classes, #alert_description_html_attributes, #render_alert_description

Constructor Details

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

Returns a new instance of AlertDescriptionComponent.

Parameters:

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

    Additional CSS classes to merge

  • attributes (Hash)

    Additional HTML attributes



11
12
13
14
# File 'app/view_components/ui/alert_description_component.rb', line 11

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

Instance Method Details

#callObject



16
17
18
19
20
# File 'app/view_components/ui/alert_description_component.rb', line 16

def call
  tag.div(**alert_description_html_attributes) do
    content
  end
end