We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Leo • 6 years ago

it has been passing five years now, but the information is really useful

i just need to add when you are using JSON.parse you only need loading json content
it helps when the information is from an external resource like an api

DaveEveritt • 4 years ago

if the structure was

"name" {
"title": "Ruby In Rails",
"url": "https://rubyinrails.com",
"posts": {
"1":" strftime-time-format-in-ruby",
"2": "what-is-gemset"
}
}

How would I access a specific post? data_hash['name']['posts']['1'] seems to fail?

disqus_6fbx5yiOem • 11 years ago

If there are multiple records in the json file then the above method gives the following error -- "JSON::ParserError: 746: unexpected token at.... " How to read multiple records?

Amutha • 11 years ago

how to connect to postgresql using ruby

kumar • 11 years ago

how to connect couchdb database in config.json and rubyfile