I have a Flight
model nested inside a FlightLog
model. A FlightLog
may contain many flights.
I'm using SimpleForm with the bootstrap installation, which makes it possible to surround form elements with errors with the error class when a validation fails.
The problem is, that even though validations are triggered for the nested model, the fields with errors inside the simple_fields_for are not being marked, so it's not possible to determine which attribute is not valid.
After examining the errors hash when calling the create action, I can see that it is correctly populated with the errors at the top level, and the errors of the nested resources inside each resource.
How could I modify the behavior of simple_form to add the errors class to the control group of each nested model to match the behavior of the parent?
Thanks in advance.