aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2006-03-16 20:30:01 +0000
committerJamis Buck <jamis@37signals.com>2006-03-16 20:30:01 +0000
commit795c71f2ee60f53e8b9a6b964700c0245d8ec5f1 (patch)
tree6b93e33572e1fc79c8745b560b2dd40768fe3021 /activesupport
parent17e1f7b3547600964204d06df37c33a540e7f699 (diff)
downloadrails-795c71f2ee60f53e8b9a6b964700c0245d8ec5f1.tar.gz
rails-795c71f2ee60f53e8b9a6b964700c0245d8ec5f1.tar.bz2
rails-795c71f2ee60f53e8b9a6b964700c0245d8ec5f1.zip
dasherize the root element when doing to_xml
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/array/conversions.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/hash/conversions.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/conversions.rb b/activesupport/lib/active_support/core_ext/array/conversions.rb
index e0e5a36cfd..b516f58bff 100644
--- a/activesupport/lib/active_support/core_ext/array/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -38,7 +38,7 @@ module ActiveSupport #:nodoc:
children = options.delete(:children)
options[:builder].instruct! unless options.delete(:skip_instruct)
- options[:builder].tag!(root) { each { |e| e.to_xml(options.merge({ :skip_instruct => true, :root => children })) } }
+ options[:builder].tag!(root.to_s.dasherize) { each { |e| e.to_xml(options.merge({ :skip_instruct => true, :root => children })) } }
end
end
end
diff --git a/activesupport/lib/active_support/core_ext/hash/conversions.rb b/activesupport/lib/active_support/core_ext/hash/conversions.rb
index 4cd171a6d1..31779e6b20 100644
--- a/activesupport/lib/active_support/core_ext/hash/conversions.rb
+++ b/activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -20,7 +20,7 @@ module ActiveSupport #:nodoc:
options.reverse_merge!({ :builder => Builder::XmlMarkup.new(:indent => options[:indent]), :root => "hash" })
options[:builder].instruct! unless options.delete(:skip_instruct)
- options[:builder].__send__(options[:root]) do
+ options[:builder].__send__(options[:root].to_s.dasherize) do
for key in keys
value = self[key]