Created
November 8, 2011 17:54
-
-
Save calvincorreli/1348532 to your computer and use it in GitHub Desktop.
Set default form builder with autoload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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