diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-07-19 22:30:00 +0900 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-07-19 22:31:55 +0900 |
commit | b20d68446d2fe98d129385a17a3a4cdacd4b5025 (patch) | |
tree | 431c555eb004f56d9db6c3a7efac87cebeb50fca /actionpack/lib/action_view/helpers | |
parent | 0f2914be405410e824b40dcff28e5dfa541bdb2a (diff) | |
download | rails-b20d68446d2fe98d129385a17a3a4cdacd4b5025.tar.gz rails-b20d68446d2fe98d129385a17a3a4cdacd4b5025.tar.bz2 rails-b20d68446d2fe98d129385a17a3a4cdacd4b5025.zip |
Move default_form_builder to ActionView so it'll work in environments not using ActionView::Base
Diffstat (limited to 'actionpack/lib/action_view/helpers')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_helper.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb index 6d6d623938..a74709e98a 100644 --- a/actionpack/lib/action_view/helpers/form_helper.rb +++ b/actionpack/lib/action_view/helpers/form_helper.rb @@ -488,7 +488,7 @@ module ActionView object_name = ActionController::RecordIdentifier.singular_class_name(object) end - builder = options[:builder] || ActionView::Base.default_form_builder + builder = options[:builder] || ActionView.default_form_builder yield builder.new(object_name, object, self, options, block) end @@ -1054,9 +1054,21 @@ module ActionView end end - class << Base + class << ActionView attr_accessor :default_form_builder end - Base.default_form_builder = ::ActionView::Helpers::FormBuilder + self.default_form_builder = ::ActionView::Helpers::FormBuilder + + # 2.3 compatibility + class << Base + def default_form_builder=(builder) + ActionView.default_form_builder = builder + end + + def default_form_builder + ActionView.default_form_builder + end + end + end |