rails.nerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2010-Nov-07 08:15 UTC
making your own FormBuilder
Hey all So I can follow this and make my own form helpers by extending FormBuilder ...http://www.sepcot.com/blog/2008/05/Accessible-Field- Errors 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! :) -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
rails.nerd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2010-Nov-07 11:31 UTC
Re: making your own FormBuilder
I could easily do this: ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| html_tag } But that kills the default functionality for ActionView::Helpers::FormBuilder 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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.