title: rails save select_tag value
body: <p>I'am using <code>select_tag</code> and when I update selected value is not stored</p>
  
  <p>when i update :name, :tag value get first option</p>
  
  <p>edit.html.erb</p>
  
  <pre><code>    &lt;%= form_for(@name) do |f| %&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :name %&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :lname%&gt;&lt;br /&gt;
      &lt;%= f.text_field :lname%&gt;
    &lt;/div&gt;
  
    &lt;div class="field"&gt;
      &lt;%= f.label :tag %&gt;&lt;br /&gt;
      &lt;%= f.select :tag, "&lt;option&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;&lt;option&gt;3&lt;/option&gt;&lt;option&gt;4&lt;/option&gt;".html_safe %&gt;
    &lt;/div&gt;
  
    &lt;div class="actions"&gt;
      &lt;%= f.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <hr>
  
  <p><strong>Solution</strong></p>
  
  <pre><code>&lt;%= f.collection_select(:tag, [1,2], :to_i, :to_s, :prompt =&gt; 'Categories') %&gt;
  </code></pre>