title: rails submit additional parameters of check boxes to create action
body: <p>I created a new rails project and generated some scaffolds.</p>
  
  <p>For this question I will talk about two models/entities/classes:</p>
  
  <pre><code>Model_A
  Model_B
  </code></pre>
  
  <p>I'm talking about a fresh setup of the rails project and automatically generated code when using scaffold.</p>
  
  <p>The relationship between <code>Model_A</code> and <code>Model_B</code> is: <code>Model_A</code> has many <code>Model_B</code>s and <code>Model_B</code> belongs to <code>Model_A</code></p>
  
  <p>I want to edit the New-Form in <code>new.html.erb</code> of <code>Model_A</code>. When calling <code>/Model_As</code> in a browser it shows me the form. I updated the form so it shows me a list of every <code>Model_B</code> Object I created before. Every line contains a <code>check_box</code> and here is my problem:</p>
  
  <p>When I call <code>/Model_As</code> I want to create a new object of <code>Model_A</code>. <code>Model_A</code> has many <code>Model_B</code> so it would be nice to check some listed <code>Model_B</code> Objects and when I press submit the <code>Model_A</code> Object will be created with references to the checked <code>Model_B</code> Objects. Doesn't sound that tricky but I can't solve it.</p>
  
  <p>How do I have to modify the <code>Model_A</code> controller? Do I have to add a route? And how does my form-code has to look like?</p>
  
  <p>I know about the <code>form_helper</code> for <code>check_box_tag</code> but no luck yet.</p>
  
  <p>Ether I do get the necessary <code>params</code> (an array of the ids of the check object) but the <code>Model_A</code> object is not getting created. Or the object is getting creating but the ids are not submitted.</p>
  
  <p>I think this is no problem for experienced ruby/rails developers. I am new to this stuff.</p>
  
  <p>Thanks!</p>