Class: Practical::Views::Form::ErrorListItemComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Practical::Views::Form::ErrorListItemComponent
- Defined in:
- app/components/practical/views/form/error_list_item_component.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #before_render ⇒ Object
- #call ⇒ Object
-
#initialize(error:) ⇒ ErrorListItemComponent
constructor
A new instance of ErrorListItemComponent.
Constructor Details
#initialize(error:) ⇒ ErrorListItemComponent
Returns a new instance of ErrorListItemComponent.
6 7 8 |
# File 'app/components/practical/views/form/error_list_item_component.rb', line 6 def initialize(error:) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'app/components/practical/views/form/error_list_item_component.rb', line 4 def error @error end |
Instance Method Details
#before_render ⇒ Object
10 11 12 |
# File 'app/components/practical/views/form/error_list_item_component.rb', line 10 def before_render error.[:has_been_rendered] = true end |
#call ⇒ Object
14 15 16 17 18 |
# File 'app/components/practical/views/form/error_list_item_component.rb', line 14 def call tag.li(data: {"pf-error-type": error.type, "pf-error-visible": true}) { tag.span(error., data: { "pf-error-message": true }) } end |