Class: Practical::Views::Form::FallbackErrorsSectionComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Practical::Views::Form::FallbackErrorsSectionComponent
- Defined in:
- app/components/practical/views/form/fallback_errors_section_component.rb
Instance Attribute Summary collapse
-
#blurb ⇒ Object
readonly
Returns the value of attribute blurb.
-
#f ⇒ Object
readonly
Returns the value of attribute f.
Instance Method Summary collapse
- #finalized_options ⇒ Object
-
#initialize(f:, blurb:, options:) ⇒ FallbackErrorsSectionComponent
constructor
A new instance of FallbackErrorsSectionComponent.
- #remaining_errors ⇒ Object
Constructor Details
#initialize(f:, blurb:, options:) ⇒ FallbackErrorsSectionComponent
Returns a new instance of FallbackErrorsSectionComponent.
5 6 7 8 9 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 5 def initialize(f:, blurb:, options:) @f = f @blurb = blurb @options = end |
Instance Attribute Details
#blurb ⇒ Object (readonly)
Returns the value of attribute blurb.
4 5 6 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 4 def blurb @blurb end |
#f ⇒ Object (readonly)
Returns the value of attribute f.
4 5 6 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 4 def f @f end |
Instance Method Details
#finalized_options ⇒ Object
11 12 13 14 15 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 11 def mix({ class: ["error-section", "fallback-error-section", "wa-callout", "wa-danger"] }, @options) end |
#remaining_errors ⇒ Object
17 18 19 20 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 17 def remaining_errors return [] if f.object.try(:errors).blank? return f.object.errors.reject{|error| error.[:has_been_rendered] } end |