Class: Irelia::Form::Group::Component
- Inherits:
-
Base::Component
- Object
- Base::Component
- Irelia::Form::Group::Component
- Defined in:
- app/components/irelia/form/group/component.rb
Instance Method Summary collapse
- #group_id ⇒ Object
- #group_options ⇒ Object
-
#initialize(**options) ⇒ Component
constructor
A new instance of Component.
- #variants ⇒ Object
Constructor Details
#initialize(**options) ⇒ Component
Returns a new instance of Component.
4 5 6 7 8 |
# File 'app/components/irelia/form/group/component.rb', line 4 def initialize(**) super add_css_classes "irelia-form__group--invalid" if errors.present? end |
Instance Method Details
#group_id ⇒ Object
16 17 18 |
# File 'app/components/irelia/form/group/component.rb', line 16 def group_id "#{object_name}_#{method}_group" end |
#group_options ⇒ Object
10 11 12 13 14 |
# File 'app/components/irelia/form/group/component.rb', line 10 def .merge( id: group_id ) end |
#variants ⇒ Object
20 21 22 23 24 25 |
# File 'app/components/irelia/form/group/component.rb', line 20 def variants class_names( "irelia-form__group", "irelia-form__group--default": variant == :default ) end |