Rails how select a id on a array?
<p>I have 
model color</p>

<pre><code>has_many :colorships
has_many :products, :through =&gt; :colorships
</code></pre>

<p>model product</p>

<pre><code> has_many :colorships
 has_many :colors, through: :colorships
</code></pre>

<p>on product controller i would like by select choose a color</p>

<pre><code>def new
  Product.New
  @dropdown = @product.color_ids.collect { |co| [co.name, co.id] } 
end


def show
  Product.find(params[:id])
 color = product.color_ids.select { |i| [i.id] } 

end
</code></pre>