diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-12 18:20:14 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-09-12 18:20:14 -0300 |
commit | 495daef06141706c363df3d42ca1683706f85735 (patch) | |
tree | 9d9da820873d4caa77937e6405992ce56b18e179 /actionview/lib/action_view | |
parent | 212fcd51f9f2f5bf70782b1011e8238f8d9bdbb4 (diff) | |
parent | e18f045b6518d555f14ac84f39aa4177ea51185d (diff) | |
download | rails-495daef06141706c363df3d42ca1683706f85735.tar.gz rails-495daef06141706c363df3d42ca1683706f85735.tar.bz2 rails-495daef06141706c363df3d42ca1683706f85735.zip |
Merge pull request #12112 from adamniedzielski/fix-form-for-namespace-and-as
form_for - fix :namespace and :as options clash
Conflicts:
actionview/CHANGELOG.md
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/form_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/form_helper.rb b/actionview/lib/action_view/helpers/form_helper.rb index 8a4830d887..ead7871fc5 100644 --- a/actionview/lib/action_view/helpers/form_helper.rb +++ b/actionview/lib/action_view/helpers/form_helper.rb @@ -442,10 +442,11 @@ module ActionView object = convert_to_model(object) as = options[:as] + namespace = options[:namespace] action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :patch] : [:new, :post] options[:html].reverse_merge!( class: as ? "#{action}_#{as}" : dom_class(object, action), - id: as ? "#{action}_#{as}" : [options[:namespace], dom_id(object, action)].compact.join("_").presence, + id: (as ? [namespace, action, as] : [namespace, dom_id(object, action)]).compact.join("_").presence, method: method ) |