I'm using the Locu API and I've currently got the results from an HTTParty request into a ruby hash called data.
I've tried to call data.to_json, and this puts backslashes in my hash:
data.to_json
=> "{\"meta\":{\"limit\":25,\"cache-expiry\":3600}
Somebody else posted the same problem that was solved as follows:
puts data.to_json
Unfortunately, that does not alter my hash at all. Any ideas?
to_jsonserializes (converts) data into a string JSON, so its working as expected. What are you trying to do with the json? Render it in a controller? Import it into the database? What's not working, exactly?