Class: FoxTail::InputErrorListComponent
- Inherits:
-
BaseComponent
show all
- Includes:
- Concerns::Formable
- Defined in:
- app/components/fox_tail/input_error_list_component.rb
Instance Attribute Summary
#html_attributes
Instance Method Summary
collapse
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
fox_tail_config
Instance Method Details
#before_render ⇒ Object
22
23
24
25
26
27
|
# File 'app/components/fox_tail/input_error_list_component.rb', line 22
def before_render
super
html_attributes[:class] = classnames theme.apply(:root, self), html_class
error_messages.each { |msg| with_message msg } unless messages?
end
|
#call ⇒ Object
29
30
31
32
33
|
# File 'app/components/fox_tail/input_error_list_component.rb', line 29
def call
content_tag :ul, html_attributes do
messages.each { |msg| concat msg }
end
end
|
#render? ⇒ Boolean
18
19
20
|
# File 'app/components/fox_tail/input_error_list_component.rb', line 18
def render?
messages? || error_messages.present?
end
|