Rails form error class

This field_error_proc adds the class “error” to all invalid fields in a rails form. It needs the Nokogiri gem to be installed which is used to parse the HTML elements.

In combination with the bootstrap css, the result might look like this:

form_field_proc