# Validation error messages in Form - how to disable the ActionView::Base.field\_error\_proc?

**URL:** <https://www.ruby-forum.com/t/validation-error-messages-in-form-how-to-disable-the-actionview-base-field-error-proc/171209>\
**Category:** Rails\
**Created:** [June 28, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/validation-error-messages-in-form-how-to-disable-the-actionview-base-field-error-proc/171209 "2009-06-28T17:56:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 28, 2009, 5:56pm UTC](https://www.ruby-forum.com/t/validation-error-messages-in-form-how-to-disable-the-actionview-base-field-error-proc/171209/1 "2009-06-28T17:56:38Z")

</div>

I wrote the following code in my form view :

- Email \<%= form.text\_field :email, :size =\> "30" %\> \<%= @user.errors.on(:email) %\>

the generated html code is the following :

\<span warning-text-indent="" class="'warning-text"  
id=“email\_error”\>should look like an email address.is too short  
(minimum is 6 characters)

it’s not far from what I would like : ( getting rid of the )

\<span warning-text-indent="" class="'warning-text"  
id=“email\_error”\>should look like an email address.is too short  
(minimum is 6 characters)

is there any way to disable the ActionView::Base.field\_error\_proc in  
the config file ?

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 28, 2009, 6:04pm UTC](https://www.ruby-forum.com/t/validation-error-messages-in-form-how-to-disable-the-actionview-base-field-error-proc/171209/2 "2009-06-28T18:04:19Z")

</div>

On Jun 28, 11:55 am, Erwin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> is there any way to disable the ActionView::Base.field\_error\_proc in  
> the config file ?

You could set ActionView::Base.field\_error\_proc to a proc that is just  
a no-op.

Fred

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [June 28, 2009, 11:48pm UTC](https://www.ruby-forum.com/t/validation-error-messages-in-form-how-to-disable-the-actionview-base-field-error-proc/171209/3 "2009-06-28T23:48:41Z")

</div>

Thanks Fred I’ll try

additional Q: when multiple errors on the same field, writing :

\<span id=‘email\_error’ class='warning-text warning-text-indent'\>\<%=  
@user.errors.on(:email) %\>

produce a concatenated string like :

is too short (minimum is 6 characters)should look like an email  
address.is too short (minimum is 3 characters)should use only letters,  
numbers, spaces, and .-\_@ please.

how can I get ‘return’ inserted between each error ?  
is too short (minimum is 6 characters)  
should look like an email address.  
is too short (minimum is 3 characters)should use only letters,  
numbers, spaces, and .-\_@ please

this is what field\_error\_proc helper is doing , I guess, but I am not  
so experienced to rewrite it …

On 28 juin, 18:03, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
