Grails g:select add HTML 5 data attributes
<p>I want to load extra data into each select option of Grails <code>g:select</code> taglib. Required output is like the following:</p>

<pre><code>&lt;select id="select"&gt;
  &lt;option value="1" data-foo="dogs"&gt;this&lt;/option&gt;
  &lt;option value="2" data-foo="cats"&gt;that&lt;/option&gt;
  &lt;option value="3" data-foo="gerbils"&gt;other&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>I am not able to find a way to add the extra data to the taglib using the data attributes of HTML 5. So how to achieve the similar output?</p>