Currently when there is a validation error, a div
with class="field_with_errors"
gets rendered in my form:
<form method="post" action="/users" accept-charset="UTF-8">
<div class="field_with_errors">
<input id="user_email" type="text" value="tom@test.com" name="user[email]">
</div>
<input id="user_password" type="password" value="mypass" size="30" name="user[password]">
<input id="user_submit" type="submit" value="Submit" name="commit">
</form>
Without the use of an additional gem and in a Rails 3 environment, is there a way to modify how the validation error is rendered? For example, I want the validation error div
to be rendered after the input
tag with the error:
<input id="user_email" type="text" value="tom@test.com" name="user[email]"><div class="field_with_errors"></div>
Also, is there a way to render a specific error? If it was an email error, then render the div
after the input textbox and produce a "Re-enter your email" message.
(Most of the searches I have done so far use gems as the solution.)