title: Set HTML id attribute in Rails form select box
body: <p>How do I set the id attribute in my drop down boxes?</p>
  
  <p>Here is the part of my form in question:</p>
  
  <pre><code>&lt;%= f.fields_for :items do |builder| %&gt;
    &lt;%= builder.label :description %&gt;&lt;br /&gt;
    &lt;%= builder.text_field :description %&gt;&lt;br /&gt;
    &lt;%= builder.label :material %&gt;&lt;br /&gt;
    &lt;%= builder.select :material, @letters.map { |l| [l.material, l.material] }, :id =&gt; "material_field" %&gt;&lt;br /&gt;
    &lt;%= builder.label :height %&gt;&lt;br /&gt;
    &lt;%= builder.select :height, @letters.map { |l| [l.height, l.height] }, :id =&gt; "height_field" %&gt;&lt;br /&gt;
    &lt;%= builder.label :thickness %&gt;&lt;br /&gt;
    &lt;%= builder.select :thickness, @letters.map { |l| [l.thickness, l.thickness] }, :id =&gt; "thickness_field" %&gt;&lt;br /&gt;
  
    &lt;%= builder.label :quantity %&gt;&lt;br /&gt;
    &lt;%= builder.text_field :quantity, :id =&gt; "quantity_field" %&gt;
    &lt;%= builder.link_to_remove "Remove this item" %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The :id => "quantity_field" method works for text fields, but not for the select fields.  Viewing the HTML source I am getting an id of "estimate_items_attributes_0_material" for the material text box.</p>
  
  <p>This is a strange inconsistency.  Any help will be greatly appreciated.</p>