title: How do I parse JSON with Ruby on Rails?
body: <p>I'm looking for a simple way to parse JSON, extract a value and write it into a database in Rails.</p>
  
  <p>Specifically what I'm looking for, is a way to extract <code>shortUrl</code> from the JSON returned from the bit.ly API: </p>
  
  <pre><code>{
    "errorCode": 0,
    "errorMessage": "",
    "results":
    {
      "http://www.foo.com":
      {
         "hash": "e5TEd",
         "shortKeywordUrl": "",
         "shortUrl": "http://bit.ly/1a0p8G",
         "userHash": "1a0p8G"
      }
    },
    "statusCode": "OK"
  }
  </code></pre>
  
  <p>And then take that shortUrl and write it into an ActiveRecord object associated with the long URL.</p>
  
  <p>This is one of those things that I can think through entirely in concept and when I sit down to execute I realize I've got a lot to learn. </p>