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
Rails now have a nice trick up its sleeve..When an error occurs rails put a div with a class .field_with_errors around the error fields. So now you can just target that class and add styling.
To focus on the input you can do
.field_with_errors input{
border: 1px solid red !important;
}
this css will put a nice red line around the input element while important! will overwrite any existing styles.