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

taavo edited this page Oct 29, 2012 · 5 revisions
def custom_nested_form_for(*args)
  options = args.extract_options!.reverse_merge(:builder => CustomNestedFormBuilder)
  form_for(*(args << options)) do |f|
    yield(f).to_s << after_nested_form_callbacks
  end
end
class CustomNestedFormBuilder < ActionView::Helpers::FormBuilder
  include NestedForm::BuilderMixin
end