title: Saving enum from select in Rails 4.1
body: <p>I am using the enums in Rails 4.1 to keep track of colors of wine.</p>
  
  <p><strong>Wine.rb</strong></p>
  
  <pre><code>class Wine &lt; ActiveRecord::Base
      enum color: [:red, :white, :sparkling]
  end
  </code></pre>
  
  <p>In my view, I generate a select so the user can select a wine with a certain color</p>
  
  <pre><code>f.input :color, :as =&gt; :select, :collection =&gt; Wine.colors
  </code></pre>
  
  <p>This generates the following HTML:</p>
  
  <pre><code>&lt;select id="wine_color" name="wine[color]"&gt;
    &lt;option value=""&gt;&lt;/option&gt;
    &lt;option value="0"&gt;red&lt;/option&gt;
    &lt;option value="1"&gt;white&lt;/option&gt;
    &lt;option value="2"&gt;sparkling&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>However, upon submitting the form, I receive an argument error stating <code>'1' is not a valid color</code>. I realize this is because <code>color</code> must equal <code>1</code> and not <code>"1"</code>. </p>
  
  <p>Is there a way to force Rails to interpret the color as an integer rather than a string?</p>