Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

How To: Custom nested form builders

lest edited this page Nov 10, 2012 · 5 revisions
def custom_nested_form_for(*args, &block)
  options = args.extract_options!.reverse_merge(:builder => CustomNestedFormBuilder)
  form_for(*(args << options)) do |f|
    capture(f, &block).to_s << after_nested_form_callbacks
  end
end
class CustomNestedFormBuilder < ActionView::Helpers::FormBuilder
  include NestedForm::BuilderMixin
end