The validation methods (validates_uniqueness_of or validates_presence_of for example) add a div tag around the input that is validated.
I think it would be wiser to add a class parameter to the input. If a class parameter is already present, a new class value should be added to the actual value.
For example, instead of :
<div class="fieldWithErrors"><input id="account_username" class="big" name="account[username]" size="30" type="text" value="" /></div>
it should be :
<input id="account_username" class="big fieldWithErrors" name="account[username]" size="30" type="text" value="" />
In fact, the div that is added can totally break the html source, for example if a fieldset or a p tag is set around the input tag, the html validator from the w3c gets hurt !