I have next group of controls:
.control-group.string.required.user_name
= f.input_field :name, required: true, class: 'form-control'
= f.label 'User Name'
= f.error :name
Is there any way to bind '.control-group' to it's child input, so if input is invalid, wrapper will get class ".error" added?
Thanks
I've created a custom component for that, which looks as follows
Now there is a question, if it's possible to detect type of an input inside this config? Because currently to explicitly set a type of an input, I'm writing "input_html: { type: 'text'}" for needed input, but that would be awesome to handle this case inside a wrapper config. Like if type is 'email' - then insert type 'text'.