diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-04-14 11:23:49 -0400 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-04-14 11:23:49 -0400 |
commit | 9ec54d950004f102c8ca040608611e3ca668b284 (patch) | |
tree | 55d0bf2fb2b56dc30fbda6302e5a3d069ea149f3 /actionview/lib/action_view | |
parent | db8897c2de254f542a108144951bcc6a142236f7 (diff) | |
parent | 2b8acdcd21e61a69eefb5c3ef132995c287c0a8e (diff) | |
download | rails-9ec54d950004f102c8ca040608611e3ca668b284.tar.gz rails-9ec54d950004f102c8ca040608611e3ca668b284.tar.bz2 rails-9ec54d950004f102c8ca040608611e3ca668b284.zip |
Merge pull request #19736 from kmcphillips/master
Set default form builder for a controller
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/controller_helper.rb | 1 | ||||
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/controller_helper.rb b/actionview/lib/action_view/helpers/controller_helper.rb index 74ef25f7c1..3569fba8c6 100644 --- a/actionview/lib/action_view/helpers/controller_helper.rb +++ b/actionview/lib/action_view/helpers/controller_helper.rb @@ -14,6 +14,7 @@ module ActionView if @_controller = controller @_request = controller.request if controller.respond_to?(:request) @_config = controller.config.inheritable_copy if controller.respond_to?(:config) + @_default_form_builder = controller.default_form_builder if controller.respond_to?(:default_form_builder) end end diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index ece117b547..7fdeca5ea8 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -114,6 +114,8 @@ module ActionView include ModelNaming include RecordIdentifier + attr_internal :default_form_builder + # Creates a form that allows the user to create or update the attributes # of a specific model object. # @@ -1233,7 +1235,7 @@ module ActionView end def default_form_builder_class - builder = ActionView::Base.default_form_builder + builder = default_form_builder || ActionView::Base.default_form_builder builder.respond_to?(:constantize) ? builder.constantize : builder end end |