title: Rails form_for check_box
body: <p>I'm trying to create a basic survey app. On my take survey page I'm looping through and displaying each answer option as a radio button or checkbox as a form_for to create a user's choice. The choices are working great for the questions that are single choice (or radio buttons), but they aren't saving for multi select questions. I'm pretty sure this has to do with the form I have for the checkbox.</p>
  
  <p>It seems like I should do           </p>
  
  <pre><code>&lt;%= f.check_box :answer_id, answer.id %&gt; &lt;%= answer.title %&gt; &lt;br&gt;
  </code></pre>
  
  <p>similar to how I'm creating the radio button but that throws an error</p>
  
  <pre><code>undefined method `merge' for 14:Fixnum
  </code></pre>
  
  <p>Here's my code that displays:</p>
  
  <pre><code>&lt;h3&gt;Questions:&lt;/h3&gt;
  &lt;ul&gt;&lt;% @survey.questions.each do |question| %&gt;
      &lt;li&gt;&lt;p&gt;&lt;%= question.title %&gt;&lt;/p&gt;&lt;/li&gt;
      &lt;% choice = question.choices.build %&gt;
      &lt;% if question.single_response == true %&gt;
      &lt;%= form_for [question, choice] do |f| %&gt;
  
              &lt;% question.answers.each do |answer| %&gt;
              &lt;%= f.radio_button :answer_id, answer.id %&gt; &lt;%= answer.title %&gt;&lt;br&gt;
              &lt;% end %&gt;
              &lt;%= f.hidden_field :survey_id, value: @survey.id %&gt;
              &lt;%= f.submit %&gt;
              &lt;% end %&gt;
  
              &lt;br /&gt;
              &lt;% else %&gt;
                  &lt;%= form_for [question, choice] do |f| %&gt;
                      &lt;% question.answers.each do |answer| %&gt;
                      &lt;%= f.check_box :answer_id %&gt; &lt;%= answer.title %&gt; &lt;br&gt;
                      &lt;%= f.hidden_field :survey_id, value: @survey.id %&gt;
                      &lt;% end %&gt;
                      &lt;%= f.submit %&gt;
              &lt;% end %&gt;
              &lt;br /&gt;
          &lt;% end %&gt;
  &lt;% end %&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>Any idea what I need to do to get it to save the answer_id to the choice so that it actually creates the choice?</p>
  
  <p>Thanks!</p>