The docs say this:
{ :name => "Konata Izumi", 'age' => 16, 1 => 2 }.to_json
=> {"name": "Konata Izumi", "1": 2, "age": 16}
But when I actually try it in the rails console it looks like this:
{ :name => "Konata Izumi", 'age' => 16, 1 => 2 }.to_json
=> "{\"name\":\"Konata Izumi\",\"age\":16,\"1\":2}"
How do I get it to return an object/hash instead of a string? I don't want the outer quotes around the curly braces. I want {...} instead of "{...}".
{ :name => "Konata Izumi", 'age' => 16, 1 => 2 }this is already a hash, no need to doto_json.