aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-22 02:33:12 -0700
committerJosé Valim <jose.valim@gmail.com>2011-06-22 02:33:12 -0700
commit3c8c37984865221bdb6e1ed0a04a30d2785a3b85 (patch)
treed25b67acd7fe1542a2a93d9f7cb8b749031a4e27 /actionpack/lib/action_view
parent6404f8a194dd56e7167d63b385cab727f378ec8d (diff)
parent237f87089cbb01da50408cc07dffc89a7ebf6854 (diff)
downloadrails-3c8c37984865221bdb6e1ed0a04a30d2785a3b85.tar.gz
rails-3c8c37984865221bdb6e1ed0a04a30d2785a3b85.tar.bz2
rails-3c8c37984865221bdb6e1ed0a04a30d2785a3b85.zip
Merge pull request #1778 from spohlenz/hash-models
Fix nested fields_for when Hash-based model is passed.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 3debc9cc66..0ef2357368 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -1241,7 +1241,7 @@ module ActionView
end
def fields_for(record_name, record_object = nil, fields_options = {}, &block)
- fields_options, record_object = record_object, nil if record_object.is_a?(Hash)
+ fields_options, record_object = record_object, nil if record_object.is_a?(Hash) && record_object.extractable_options?
fields_options[:builder] ||= options[:builder]
fields_options[:parent_builder] = self