Skip to content
This repository

update field_error_proc leads conflict by change field_error_proc #985

halida opened this Issue February 16, 2012 · 4 comments

3 participants

Halida Benoit Bénézech Liel Dulev

in :

ActionView::Base.field_error_proc = { |html_tag, instance| html_tag }

but in my application, I'm using client_side_validations, it use it to update form with error:

 ActionView::Base.field_error_proc = do |html_tag, instance|
   unless html_tag =~ /^<label/
     %{<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>}.html_safe
     %{<div class="field_with_errors">#{html_tag}</div>}.html_safe

form_builder override my configuration, or my configuration override form_builder, any way to fix it?

Benoit Bénézech

Yeah, the only solution I can think is a wrapper like:

field_error_proc is a total design failure (what was the guy thinking???)...

If you want to implement the aforementioned hack, RA form_builder is here:

Have fun!


my solution, is to fork rails_admin, and delete field_error_proc:

works for me.

Benoit Bénézech

This should be fixed. This can be an issue for other libraries/code.

Liel Dulev


Benoit Bénézech bbenezech closed this issue from a commit September 11, 2012
Benoit Bénézech fix #985
shamelessly copied from simple_form
Benoit Bénézech bbenezech closed this in 909e4a1 September 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.