From a1f22f520b7b189b2d9f756fcff32093ea68fffd Mon Sep 17 00:00:00 2001 From: CassioMarques Date: Sun, 28 Dec 2008 22:56:51 -0200 Subject: Added missing images for the AR validations and callbacks guide --- railties/doc/guides/html/activerecord_validations_callbacks.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties/doc/guides/html/activerecord_validations_callbacks.html') diff --git a/railties/doc/guides/html/activerecord_validations_callbacks.html b/railties/doc/guides/html/activerecord_validations_callbacks.html index a5356f3daf..34d911b9e2 100644 --- a/railties/doc/guides/html/activerecord_validations_callbacks.html +++ b/railties/doc/guides/html/activerecord_validations_callbacks.html @@ -1013,7 +1013,7 @@ http://www.gnu.org/software/src-highlite -->

8.1. Changing the way form fields with errors are displayed

-

By default, form fields with errors are displayed enclosed by a div element with the fieldWithErrors CSS class. However, we can write some Ruby code to override the way Rails treats those fields by default. Here is a simple example where we change the Rails behaviour to always display the error messages in front of each of the form fields with errors. The error messages will be enclosed by a span element with a validation-error CSS class.

+

By default, form fields with errors are displayed enclosed by a div element with the fieldWithErrors CSS class. However, we can write some Ruby code to override the way Rails treats those fields by default. Here is a simple example where we change the Rails behaviour to always display the error messages in front of each of the form fields with errors. The error messages will be enclosed by a span element with a validation-error CSS class. There will be no div element enclosing the input element, so we get rid of that red border around the text field. You can use the validation-error CSS class to style it anyway you want.