Skip to content

Instantly share code, notes, and snippets.

@calvincorreli
Created November 8, 2011 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save calvincorreli/1348532 to your computer and use it in GitHub Desktop.
Save calvincorreli/1348532 to your computer and use it in GitHub Desktop.
Set default form builder with autoload
module ActionView
module Helpers
module FormHelper
def form_for_with_bootstrap(record, options = {}, &proc)
options[:builder] = BootstrapFormBuilder
form_for_without_bootstrap(record, options, &proc)
end
def fields_for_with_bootstrap(record_name, record_object = nil, options = {}, &block)
options[:builder] = BootstrapFormBuilder
fields_for_without_bootstrap(record_name, record_object, options, &block)
end
alias_method_chain :form_for, :bootstrap
alias_method_chain :fields_for, :bootstrap
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment