title: How to use the 'optgroup' html tag in an f.select? (Rails)
body: <p>How can I use the 'optgroup' html tag in an f.select?</p>
  
  <p>Inside a search form I have the following field: </p>
  
  <pre><code>&lt;%= f.select :location, ["San Francisco, USA", "Mountain View, USA", "London, UK", "Stockholm, Sweden"] %&gt;
  </code></pre>
  
  <p>How to add optgroup in that, so it would become like:</p>
  
  <pre><code>&lt;select&gt;
    &lt;optgroup label="Europe"&gt;
      &lt;option value="London, UK"&gt;London, UK&lt;/option&gt;
      &lt;option value="Stockholm, Sweden"&gt;Stockholm, Sweden&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="USA"&gt;
      &lt;option value="San Francisco, USA"&gt;San Francisco, USA&lt;/option&gt;
      &lt;option value="Mountain View, USA"&gt;Mountain View, USA&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>