I am adding an error to a field in a form thus:
company.errors.add_to_base(“Please select either distributor or
manufacturer”)
However, the add_to_base method doesn’t wrap the field where the error
occurred in a field_with_errors div, and thus the field isn’t
highlighted.
Is there any way to achieve this manually?
I tried adding a nil error to the attribute:
company.errors.add(:isVertrieb, nil), but this results in the field’s
name being output in the list of validation errors.