How do you display form field highlighting for fields that fail validation errors in Rails 3.1? I know that scaffolding automatically generates the css and controller code t
I had to do this (resource.errors[field_name].length > 0) to get it to work:
def field_class(resource, field_name) if resource.errors[field_name].length > 0 return " custom_error1 ".html_safe else return "".html_safe end end