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.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #finalized_options ⇒ Object
-
#initialize(f:, id:, blurb:, options:) ⇒ FallbackErrorsSectionComponent
constructor
A new instance of FallbackErrorsSectionComponent.
- #remaining_errors ⇒ Object
Constructor Details
#initialize(f:, id:, blurb:, options:) ⇒ FallbackErrorsSectionComponent
Returns a new instance of FallbackErrorsSectionComponent.
5 6 7 8 9 10 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 5 def initialize(f:, id:, blurb:, options:) @f = f @id = id @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 |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 4 def id @id end |
Instance Method Details
#finalized_options ⇒ Object
12 13 14 15 16 17 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 12 def mix({ data: {"pf-error-container": true, "pf-fallback-error-section": true}, id: id }, @options) end |
#remaining_errors ⇒ Object
19 20 21 22 |
# File 'app/components/practical/views/form/fallback_errors_section_component.rb', line 19 def remaining_errors return [] if f.object.try(:errors).blank? return f.object.errors.reject{|error| error.[:has_been_rendered] } end |