title: How do I access a hash inside an array inside a ruby object?
body: <p>I'm using the publicactivity gem to audit activity within my application.</p>
  
  <p>Using MongoDB, and none of the data below is real - but representative of real data.</p>
  
  <p>I shoved in some data like this:</p>
  
  <pre><code>"changes" : [
          {
              "oldFirst" : "Aaron2",
              "oldLast" : "Aardvark2",
              "oldCity_id" : "Bogota, TN",
              "oldZip_code" : 38007,
              "oldPhone" : [
                  "9993339999",
                  "4442224443"
              ],
              "oldStreet1" : "1111 Brighton Clopton St",
              "oldStreet2" : "Suite 100",
              "oldEmail" : [
                  "uk@tel.com"
              ],
              "oldType" : "customer",
              "oldLatitude" : "36.1625531",
              "oldLongitude" : "-89.4362431",
              "oldCust_notes" : "",
              "oldAccount_id" : ""
          },
          {
              "newFirst" : "Aaron",
              "newLast" : "Aardvark",
              "newCity_id" : "Brighton, TN",
              "newZip_code" : 38011,
              "newPhone" : [
                  "9993338888",
                  "4442223334"
              ],
              "newStreet1" : "1111 Brighton Clopton Dr.",
              "newStreet2" : "",
              "newEmail" : [
                  "uk@tel.com"
              ],
              "newType" : "customer",
              "newLatitude" : "35.4558615",
              "newLongitude" : "-89.68162079999999",
              "newCust_notes" : "",
              "newAccount_id" : ""
          }
      ]
  </code></pre>
  
  <p>So how do I talk about these elements?</p>
  
  <p>I tried:</p>
  
  <pre><code>&lt;%= activity.changes[0]["oldFirst"] %&gt;
  &lt;%= activity.changes["oldFirst"] %&gt;
  &lt;%= activity.changes.oldFirst %&gt;
  &lt;% if activity.changes.any?
    activity.changes.each do |c|
  %&gt;
  &lt;%= c["oldfirst"] %&gt;
  &lt;%end%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>etc.</p>
  
  <p>On and on I tried the combinations I know of - and I'm getting this:</p>
  
  <pre><code>no implicit conversion of String into Integer
  </code></pre>
  
  <p>String into Integer?!  WTF?  It's all string-type data, and I'm trying to access it out as string-type data - I don't understand why it thinks I have or want Integer values.</p>
  
  <p>I can haz help?</p>