title: Iterating over JSON in Rails
body: <p>I have a single-line JSON file I'm trying to iterate over and looking for the best way to loop through it.</p>
  
  <p>Exploded out, it looks something like:</p>
  
  <pre><code>{
   "system": "Test",
   "Continents": [
      {
          "Continent": {
              "name": "Europe",
              "location": "North"
           },
          "Continent": {
              "name": "Australia",
              "location": "South"
           },
          "Continent": {
              "name": "Asia",
              "location": "North"
           }
       }  
    ]
  }
  </code></pre>
  
  <p>To start, I'm loading in the JSON with the following, which successfully loads the full JSON. </p>
  
  <pre><code>File.open(json_file, 'r') do |file|
  
      file.each do |line|            
  
        JSON.parse(line).each do |item|
  
          ## CODE TO ITERATE HERE
  
        end        
      end
   end
  </code></pre>
  
  <p>What I'm not sure how to do is to loop through the <code>Continents</code> section and pull the associated records. The goal would be to loop through and output the info in a list/table/display.</p>
  
  <p>Thanks for the help - let me know if I can clarify at all.</p>