title: Rails: how do I set ID or Name attribute in text_field_tag?
body: <pre><code>&lt;%= text_field_tag :barcode, params[:barcode] %&gt;
  </code></pre>
  
  <p>generates</p>
  
  <pre><code>&lt;input id="barcode" name="barcode" type="text"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>but I need</p>
  
  <pre><code>&lt;input type="text" name="barcode" id="autocomplete"&gt;&lt;/input&gt;
  </code></pre>
  
  <p>But in the <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#method-i-text_field_tag" rel="nofollow noreferrer">documentation</a> I did not find a way how to change the ID attribute.</p>
  
  <p>I need to use a text_field_tag because it fills the textbox with params if submit fails.</p>