Take a look at this link in the rails guide http://guides.rubyonrails.org/activerecord_validations_callbacks.html#customizing-the-error-messages-html. This should let you customize the html for the errors however you would like.
This example will leave the html form field exactly the same, even if there are errors.
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance|
%(#{html_tag})
end
Next we can add a helper method to render the errors:
def custom_error_message_on(object, method)
errors = object.errors.on(method)
"#{ERB::Util.html_escape(errors.is_a?(Array) ? errors.first : errors)}"
end
I basically just stripped down what the normal error_message_on does for what you need.
Now you can use it in your page like so:
<%= f.password_field :password %>
<%= custom_error_message_on :user, :password %>
and the html output will be something like this:
<input type='password' name='password' />
Your password is required
This will let you put whatever extra markup you need and wont restrict you to doing it one way for all your forms.
Another thing you might want to take a look at if you have a number of forms that follow the same pattern is the custom form builders http://ramblingsonrails.com/how-to-make-a-custom-form-builder-in-rails.