title: How to save values of a JSON response in a rails database?
body: <p>I want to access the Facebook Graph API and get JSON responses like this:</p>
  
  <pre><code>{
    "data": [
      {
        "name": "Coldplay", 
        "category": "Musician/band", 
        "id": "15253175252", 
        "created_time": "2012-01-27T22:51:44+0000"
      },
      {
        "name": "R.E.M.", 
        "category": "Musician/band", 
        "id": "8759772983", 
        "created_time": "2012-01-27T22:51:43+0000"
      }
    ], 
    "paging": {
      "next": "https://graph.facebook.com/1000032123447/music?format=json&amp;limit=5000&amp;offset=5000&amp;__after_id=8123918"
    }
  }
  </code></pre>
  
  <p>Now I want to save the name, the category and id into my rails database.
  I have got a table with the same columns.</p>
  
  <p>What is the easiest way to save this response into the matching columns of the database? Or is there a better solution, i.e. just saving the whole json object into the database and read it later on in the code again?</p>
  
  <p>If you have time, please provide a coding example for the javascript/jQuery (ajax maybe) and ruby code. Thank you so much!</p>