title: Ruby on rails form.select "undefined method"
body: <p>In an erb file I'm trying to create a drop-down menu and save the selection to the database upon submission. I have this chunk of code:</p>
  
  <pre><code>&lt;% form_for my_object do |form|%&gt;
  
    &lt;% option_pairs = values.map { |val| [val.id, val.id] } %&gt;
    &lt;%= form.select :var_to_save_to, options_for_select(option_pairs) %&gt;
  
  &lt;% end %&gt;
  </code></pre>
  
  <p>However, when I try loading the page I get an error saying <code>undefined method 'var_to_save_to' for #&lt;MyObjectClass&gt;</code></p>
  
  <p>Does anyone know what might be causing this?</p>
  
  <p>Thanks</p>