title: Loop through array of hashes in rails
body: <p>I have the following array of hashes that I send to my controller:</p>
  
  <pre><code>comparisons = [{
    "startdate": "01/01/2016",
    "enddate": "01/02/2016"
  }, {
    "startdate": "01/03/2016",
    "enddate": "01/04/2016"
  }, {
    "startdate": "01/05/2016",
    "enddate": "01/06/2016"
  }, {
    "startdate": "01/05/2016",
    "enddate": "01/06/2016"
  }];
  
  $.ajax({
    url: '/get_data',
    method: 'GET',
    dataType: 'JSON',
    data: {
      startdate: '01/01/2016',
      enddate: '01/01/2016',
      comparisons: comparisons
    },
    success: function (data) {
      console.log(data);
    }
  });
  </code></pre>
  
  <p>And then in the controller I want to loop through these comparisons:</p>
  
  <pre><code>@comparisons = []
  if !params[:comparisons].blank?
    params[:comparisons].each do |c|
      @comparisons.push({:startdate =&gt; c[:startdate], :enddate =&gt; c[:enddate], :data =&gt; get_data(c[:startdate], c[:enddate], 'week')})
    end
  end
  </code></pre>
  
  <p>I get an error: <code>&gt; no implicit conversion of Symbol into Integer</code></p>
  
  <p>And when debugging I'm finding that the <code>c</code> in my loop isn't structured the same as what I'm sending...</p>
  
  <p><code>c: ["0", {"startdate"=&gt;"01/01/2016", "enddate"=&gt;"01/01/2016"}]</code></p>
  
  <p>How can I fix this?</p>