title: form multiple select
body: <p>I am learning rails and have been struggling with this for over a day now and can not figure out how to get this to work. I want a select box in my form that can select multiple elements. I have this working with this code:</p>
  
  <pre><code>&lt;div class="field"&gt;
  &lt;%= f.label :products %&gt;&lt;br /&gt;
  &lt;%= f.select :products, {"A"=&gt;1, "B"=&gt;2, "C"=&gt;3, "D"=&gt;4},{},:size=&gt;5,:multiple=&gt;true %&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This works fine and produces this HTML:</p>
  
  <pre><code>&lt;div class="field"&gt; 
  &lt;label for="script_products"&gt;Products&lt;/label&gt;&lt;br /&gt; 
  &lt;select id="script_products" multiple="multiple" name="script[products][]" size="5"&gt;         
  &lt;option value="1"&gt;A&lt;/option&gt; 
  &lt;option value="2"&gt;B&lt;/option&gt; 
  &lt;option value="3"&gt;C&lt;/option&gt; 
  &lt;option value="4"&gt;D&lt;/option&gt;&lt;/select&gt; 
  &lt;/div&gt;
  </code></pre>
  
  <p>What I can figure out is how the results get sent/stored. In my view for the "show" action, if I simply print out :products I get this:</p>
  
  <p>Products: --- - '1' - '2' - '3'</p>
  
  <p>If I print out :products.inspect I get this:</p>
  
  <p>Products: "---\n- '1'\n- '2'\n- '3'\n"</p>
  
  <p>and the class is a string. I would think it would be stored as an array, but I can not get it to work. I don't know where the dashes or the newlines come from.</p>