Skip to content
Browse files

dasherize the root element when doing to_xml

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3901 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 17e1f7b commit 795c71f2ee60f53e8b9a6b964700c0245d8ec5f1 @jamis jamis committed
View
2 activesupport/lib/active_support/core_ext/array/conversions.rb
@@ -38,7 +38,7 @@ def to_xml(options = {})
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
View
2 activesupport/lib/active_support/core_ext/hash/conversions.rb
@@ -20,7 +20,7 @@ def to_xml(options = {})
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]

0 comments on commit 795c71f

Please sign in to comment.
Something went wrong with that request. Please try again.