sethvargo/bootstrap_forms — pull request #44 by imaus10 (2012-06-18 23:15:15+00:00)
Title: Allow custom fields by extending the FormBuilder

I have a project with a custom field like so:

class MyCustomFormBuilder < ActionView::Helpers::FormBuilder
def custom_field
end
end

When I added bootstrap_forms to the project, I could not use the same functionality. This commit mimics the way ActionView did it (mostly).

So now I can say

class MyCustomFormBuilder < BootstrapForms::FormBuilder
def custom_field
end
end

and pop it into the bootstrap_form_for :builder option or put this in an initializer

BootstrapForms::FormBuilder.default_form_builder = MyCustomFormBuilder