I implemented a custom form builder called BootstrapFormBuilder. I
to use it as the default form builder. I did manage to do that but not
without problems. I’d like you to help me understand why my initial
approach didn’t work.
I put my class in app/helpers/bootstrap_form_builder.rb. Following the
Rails Guide I added:
to an initializer. Unfortunately form_for was still using the default
builder. I had to change the line above to:
ActionView::Base.default_form_builder = BootstrapFormBuilder
That approach worked. I have two questions:
- why didn’t my initial approach work?
- if it doesn’t change the default form builder then what does it do?