title: Iterating through items in Capybara
body: <p>I've got a page containing multiple elements of class .block. In Capybara, I want to be able to loop through and refer to each of the elements with this class before completing an action. </p>
  
  <p>However, none of the code I've tried so far has worked. Here's what I've tried:</p>
  
  <pre><code>within('.block:nth-child(1)') do
    find('.Button').click
  end
  
  page.find('.block').all.first.find('Button').click
  
  page.find('.block').all[1].find('Button').click
  </code></pre>
  
  <p>Any ideas?</p>