Highlight erroneous fields by adding a class to them
authorTom Hughes <tom@compton.nu>
Wed, 15 Jan 2014 21:09:54 +0000 (21:09 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 15 Jan 2014 21:41:16 +0000 (21:41 +0000)
commit933b0913304fdd581c7cb3f1ec30450d6e04c63a
tree1c64fc679ab90e8d3b1c9d78a633c62a85a8cffb
parent0764bb40b219a39f672b6153371bc3470346fdf0
Highlight erroneous fields by adding a class to them

The default rails scheme for highlighting errors is to wrap the
field in a div, but that changes the structure of the page and can
change the meaning of CSS rules applied to the fields.

As an alternative we now apply a class to the fields, and use that
in the CSS to apply a highlight.
app/assets/stylesheets/common.css.scss
config/initializers/field_error.rb [new file with mode: 0644]
test/functional/user_controller_test.rb
test/integration/user_creation_test.rb