Class: Railsboot::ErrorsComponent
- Inherits:
-
Component
- Object
- Component
- Railsboot::ErrorsComponent
- Defined in:
- app/components/railsboot/errors_component.rb
Instance Method Summary collapse
- #error_messages ⇒ Object
- #errors ⇒ Object
-
#initialize(*objects, **html_attributes) ⇒ ErrorsComponent
constructor
A new instance of ErrorsComponent.
- #render? ⇒ Boolean
Constructor Details
#initialize(*objects, **html_attributes) ⇒ ErrorsComponent
Returns a new instance of ErrorsComponent.
2 3 4 5 |
# File 'app/components/railsboot/errors_component.rb', line 2 def initialize(*objects, **html_attributes) @objects = Array(objects) @html_attributes = html_attributes end |
Instance Method Details
#error_messages ⇒ Object
11 12 13 |
# File 'app/components/railsboot/errors_component.rb', line 11 def errors.map(&:full_messages).flatten end |
#errors ⇒ Object
7 8 9 |
# File 'app/components/railsboot/errors_component.rb', line 7 def errors @objects.map(&:errors).flatten end |
#render? ⇒ Boolean
15 16 17 |
# File 'app/components/railsboot/errors_component.rb', line 15 def render? .any? end |