How to set a color for an option in a rails select form helper?
<p>I search on the web, and it seems we can do it by apply a <code>style: "background-color:colorName;"</code> on the desired option.</p>

<p>But after many researches and tries, I cannot find how to do this with the rails form helpers.</p>

<p>This is what I have now :</p>

<pre><code>&lt;% users_array = ["Choose your player"] %&gt;
&lt;% users_array += User.all.map { |user| [user.name, user.id ]} %&gt;
&lt;%= select("player-#{user.id}-#{category[0]}", nil, options_for_select(users_array, user.name.to_s ), { }, { class: "selectstyle col-md-2" }) %&gt;
</code></pre>

<p>I display all my model content with a default selected option specified in the <code>options_for_select</code>, but I want to add a different color to each users of my model displayed in this select.</p>

<p>The only example I found on the web are for a select without model displaying, and all my tries failed. How can I do ?</p>