title: Non-Unique ID's When Creating Form Elements for the Same Name in Rails
body: <p>I have the following line in a form I'm building in Rails:</p>
  
  <pre><code>&lt;%= text_field_tag "new_receipt[]", nil -%&gt;
  &lt;%= text_field_tag "new_receipt[]", nil -%&gt;
  </code></pre>
  
  <p>This results in the following HTML:</p>
  
  <pre><code>&lt;input type="text" name="new_receipt[]" id="new_receipt_"&gt;
  &lt;input type="text" name="new_receipt[]" id="new_receipt_"&gt;
  </code></pre>
  
  <p>The problem is the id's for both these boxes are the same.  What's the best way to get rails to create a unique ID?</p>
  
  <p>I could do</p>
  
  <pre><code>&lt;%= text_field_tag "new_receipt[]", nil, id: "new_receipt_1" -%&gt;
  &lt;%= text_field_tag "new_receipt[]", nil, id: "new_receipt_2" -%&gt;
  </code></pre>
  
  <p>but I'm wondering if there's a more automated approach.</p>