From: bradphelan Date: 2010-03-30T17:00:06+09:00 Subject: Hash to_xml from_xml Am I missing something require 'active_record' require 'active_support' require 'pp' v = Hash.from_xml %{ 1 2 3 } pp v pp v.to_xml generates {"hash"=>{"users"=>[1, 2, 3]}} /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/ core_ext/array/conversions.rb:163:in `to_xml': Not all elements respond to to_xml (RuntimeError) from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:115:in `to_xml' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:110:in `each' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:110:in `to_xml' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:134:in `call' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:134:in `_nested_structures' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:58:in `method_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:109:in `__send__' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:109:in `to_xml' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:113:in `to_xml' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:110:in `each' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:110:in `to_xml' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:134:in `call' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:134:in `_nested_structures' from /usr/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/ xmlbase.rb:58:in `method_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:109:in `__send__' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/ active_support/core_ext/hash/conversions.rb:109:in `to_xml' Any way to get this working? Brad