Finding the last element with the same class in Capybara and filling it with some text

Viewed 4457

I've following markup:

<div class='foo'>
  <form>
    <input class='bar' type='text'>
  </form>
<div/>

<div class='foo'>
  <form>
    <input class='bar' type='text'>
  </form>
</div>

I'd like to fill input in the second .foo container. How I can achieve this in Capybara ?

1 Answers
Related