title: ruby on rails: how to change BG color of options in select list
body: <p>I want to pull list of colors from model and put the color select list in the view.
  Options have value as color code. I want to change the background color of options same as its value. Below are two ways I tried to do but it comes out that it changes color for whole select list but not for individual options with individual colors.</p>
  
  <pre><code>&lt;p&gt;
      &lt;b&gt;Background color&lt;/b&gt;&lt;br /&gt;    
      collection_select(:setting, :bg_color, @colors, :code, :name, 
      options ={:prompt =&gt; "-Select a color"}, html_options = {:style =&gt; "background-color: #3f3"})
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;b&gt;New Background color&lt;/b&gt;&lt;br /&gt;
   select_tag("setting[bg_color]", "&lt;option&gt;-Select a color&lt;/option&gt;" + 
    options_from_collection_for_select(@colors, :code, :name, html_options = {:style =&gt; "background-color: #3f3"})) 
    &lt;/p&gt;
  </code></pre>
  
  <p>I want it to generate something similar to:</p>
  
  <pre><code>&lt;option value='color_code' style='background-color: color_code'  &gt;color_name&lt;/option&gt; 
  </code></pre>
  
  <p>this way, the colors in options are also visible to the users.</p>
  
  <p>anyway we can customize the options?</p>
  
  <p>thanks in advance.</p>