title: each_with_index_do starting at 1 for index
body: <p>I am using a ruby iterator on a view in a rails app like so:</p>
  
  <pre><code>&lt;% (1..@document.data.length).each_with_index do |element, index| %&gt;
    ...
  &lt;% end %&gt;
  </code></pre>
  
  <p>I thought the addition of the 1.. instead of just saying:
   <code>@document.data</code></p>
  
  <p>would get the trick of having the index above start at 1.  But alas, the above code index is still 0 to data.length (-1 effectively).  So what am I doing wrong, i need the index to equal 1-data.length...no clue how to set up the iterator to do this.</p>