search for: extendedformbuild

Displaying 1 result from an estimated 1 matches for "extendedformbuild".

Did you mean: extendedformbuilder
2007 Dec 09
0
Writing Specifications for Custom Form Builders (and Helpers)
...i created lib/ extended_form_builder.rb along with spec/lib/ extended_form_builder_spec.rb so I could start writing my specifications. So far, so good. An hour or so later, after searching, reading Rails source code and abandoning specs completely I have ended up with the very basic: class ExtendedFormBuilder < ActionView::Helpers::FormBuilder def div_with_errors_for(object_name, &block) @template.concat(@template.content_tag(:div, @template.capture(&block)), block.binding) end end Which only wraps the block I pass to it with a <div> and outputs it correctly using er...