Making your own FormBuilder

Hey all

So I can follow this and make my own form helpers by extending
FormBuilder …

Also in that tutorial it shows how to redefine “field_error_proc”

My question is … is it possible to define the “field_error_proc”
method JUST for your own version of the ForumBuilder?

Or maybe, inside the field_error_proc method, I could test to see what
class of FormBuilder is being used, and then decide on the behavior?
(super as the default?)

thanks for any suggestions!

I could easily do this:

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

But that kills the default functionality for

Struggling to find some logic to test whether the call to
field_error_proc is coming from the base ForumBuilder or the extended
version… since I’d like the leave the default one alone

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs