I have a hash
{:name =>"douglas_hettinger@braunlebsack.io"}
I am trying to convert this hash into the following JavaScript format.
{"name" : "douglas_hettinger@braunlebsack.io"}
I tried:
{:name=>"douglas_hettinger@braunlebsack.io"}.to_json
which gives the output:
"{\"name\":\"douglas_hettinger@braunlebsack.io\"}"
Parsing it with JSON gives:
JSON.parse({:name=>"douglas_hettinger@braunlebsack.io"}.to_json)
# => {"name"=>"douglas_hettinger@braunlebsack.io"}