aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_helper.rb
diff options
context:
space:
mode:
authorKevin McPhillips <github@kevinmcphillips.ca>2015-04-06 22:20:57 -0400
committerKevin McPhillips <github@kevinmcphillips.ca>2015-04-13 23:43:34 -0400
commit2b8acdcd21e61a69eefb5c3ef132995c287c0a8e (patch)
treea8ba1012769c9203eb176688ad8f59fb33686987 /actionview/lib/action_view/helpers/form_helper.rb
parentefaec3dd63df113c7931f84d6b1d80f26307d93c (diff)
downloadrails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.tar.gz
rails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.tar.bz2
rails-2b8acdcd21e61a69eefb5c3ef132995c287c0a8e.zip
Override default form builder for a controller
Diffstat (limited to 'actionview/lib/action_view/helpers/form_helper.rb')
-rw-r--r--actionview/lib/action_view/helpers/form_helper.rb4
1 files changed, 3 insertions, 1 deletions
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