As per request at #896
allows custom field_error_proc
field_error_proc spec: fix block call
It says that the build failed but it's unrelated to this commit: "Bundler could not find compatible versions for gem "bundler".
Looks great! @sobrinho any thoughts?
Looks great for me! :)
@tokland can you update the changelog?
update CHANGELOG to new module attribute field_error_proc
Is the CHANGELOG ok?
Merging, will revert if the build still fails and can't be easily resolved.
this overrides the default for rails built-in form helpers, is that the intent?
@bughit Note that the ensure restores the old value (the patch does not change that behavior, it was already there)
@@field_error_proc is the name used by ActionView::Base
the inclusion of Formtastic::Helpers::FormHelper clobbers it, the original rails value is lost
according to #39, the intent is not to alter rails native behavior, but this change does, no?
Oops, you're right, I wasn't aware that this module was included in ActionView::Base, we should use a different class variable name.
using the following work around (in an initializer):
@@_field_error_proc = @@field_error_proc
default_field_error_proc = ::ActionView::Base.field_error_proc
::ActionView::Base.field_error_proc = @@_field_error_proc
::ActionView::Base.field_error_proc = default_field_error_proc
@bughit @tokland It's great that there's a work-around, but I'd love to see either a patch for this or a roll-back of the feature, as Formtastic was deliberately designed so that it shouldn't have any impact on forms that aren't wrapped in a semantic_form_for block, and this is a regression. At the very least, could someone start or re-open an issue with everything you know so far?
I'll prepare a patch tomorrow, it's just changing the name of the field and adding an spec. I don't think I have rights to reopen issues, can't you do it?
I've re-opened #39, but at this point a new issue is probably more relevant, anyway, looking forward to your patch, thank you!