I have a problem of JSON encoding on my rails application:
h = {:status=>200, :promotions=>[{:id=>719788, :title=>"test"}]}
and result of
puts h.to_json
is
{"status":200,"promotions":{"{\"id\"=>719788, \"title\"=>\"test\"}":null}}
Which is not the expected result!
This is the correct result:
{"promotions":[{"title":"test","id":719788}],"status":200}
What could generate such error in JSON generation?
ruby -v
ruby 1.9.3p194 (2012-04-20) [x86_64-linux]
rails -v
Rails 3.1.4
gem list ==> json (1.6.6, 1.5.4)
Ok, this has nothing to do with a configuration of rails or ruby…
One of the engineer added this into core_extensions for Array
I guess I can delete this question tomorrow