title: given a json object, how to iterate through the object in rails
body: <p>My app is posting the following json object to rails.</p>
  
  <pre><code>[{\"completed\":false,\"id\":196,\"position\":0,\"title\":\"Item 1\",\"updated_at\":\"2011-08-03T21:17:09Z\"},{\"completed\":false,\"id\":193,\"position\":1,\"title\":\"Item X\",\"updated_at\":\"2011-08-03T21:16:19Z\"},{\"completed\":false,\"id\":197,\"position\":2,\"title\":\"Item 2\",\"updated_at\":\"2011-08-03T21:17:11Z\"},{\"completed\":false,\"id\":192,\"position\":3,\"title\":\"Item Z\",\"updated_at\":\"2011-08-03T21:16:17Z\"},{\"completed\":false,\"id\":194,\"position\":4,\"title\":\"Item Y\",\"updated_at\":\"2011-08-03T21:16:21Z\"},{\"completed\":false,\"id\":195,\"position\":5,\"title\":\"Item P\",\"updated_at\":\"2011-08-03T21:16:25Z\"},{\"completed\":false,\"id\":199,\"position\":6,\"title\":\"Why you no stay done?\",\"updated_at\":\"2011-08-03T23:22:41Z\"},{\"completed\":false,\"id\":200,\"position\":7,\"title\":\"Wow\",\"updated_at\":\"2011-08-04T00:02:07Z\"},{\"completed\":false,\"id\":201,\"position\":8,\"title\":\"Hello World\",\"updated_at\":\"2011-08-04T00:02:11Z\"},{\"completed\":false,\"id\":202,\"position\":9,\"title\":\"GOLDEN GATE BRIDGE CATALYST,\",\"updated_at\":\"2011-08-04T00:44:19Z\"}]
  </code></pre>
  
  <p>I'm unable to loop through the object. I can do:</p>
  
  <pre><code>JSON.parse(list_items_open).each do |item|
    Rails.logger.info item.inspect
  end
  </code></pre>
  
  <p>which outputs: </p>
  
  <pre><code>{"completed"=&gt;false, "id"=&gt;193, "position"=&gt;0, "title"=&gt;"Item X", "updated_at"=&gt;"2011-08-03T21:16:19Z"}
  {"completed"=&gt;false, "id"=&gt;197, "position"=&gt;1, "title"=&gt;"Item 2", "updated_at"=&gt;"2011-08-03T21:17:11Z"}
  {"completed"=&gt;false, "id"=&gt;192, "position"=&gt;2, "title"=&gt;"Item Z", "updated_at"=&gt;"2011-08-03T21:16:17Z"}
  {"completed"=&gt;false, "id"=&gt;196, "position"=&gt;3, "title"=&gt;"Item 1", "updated_at"=&gt;"2011-08-03T21:17:09Z"}
  {"completed"=&gt;false, "id"=&gt;194, "position"=&gt;4, "title"=&gt;"Item Y", "updated_at"=&gt;"2011-08-03T21:16:21Z"}
  {"completed"=&gt;false, "id"=&gt;195, "position"=&gt;5, "title"=&gt;"Item P", "updated_at"=&gt;"2011-08-03T21:16:25Z"}
  {"completed"=&gt;false, "id"=&gt;199, "position"=&gt;6, "title"=&gt;"Why you no stay done?", "updated_at"=&gt;"2011-08-03T23:22:41Z"}
  {"completed"=&gt;false, "id"=&gt;200, "position"=&gt;7, "title"=&gt;"Wow", "updated_at"=&gt;"2011-08-04T00:02:07Z"}
  {"completed"=&gt;false, "id"=&gt;201, "position"=&gt;8, "title"=&gt;"Hello World", "updated_at"=&gt;"2011-08-04T00:02:11Z"}
  {"completed"=&gt;false, "id"=&gt;202, "position"=&gt;9, "title"=&gt;"GOLDEN GATE BRIDGE CATALYST,", "updated_at"=&gt;"2011-08-04T00:44:19Z"}
  </code></pre>
  
  <p>But I can't get the actual id:</p>
  
  <pre><code>JSON.parse(list_items_open).each do |item|
    Rails.logger.info item[:id]
  end
  </code></pre>
  
  <p>That returns nothing. Suggestions on how to get the item ID?</p>
  
  <p>Thanks</p>