title: create records only when boxes checked
body: <p>The following PATCH action is getting the following parameters</p>
  
  <pre><code>  Parameters: {"utf8"=&gt;"✓", [...], "contractgroup"=&gt;
  {"articolocontractgroups_attributes"=&gt;
  {"0"=&gt;{"articolo_id"=&gt;"0", "id"=&gt;"425"}, 
   "1"=&gt;{"articolo_id"=&gt;"true", "id"=&gt;"426"}, 
   "2"=&gt;{"articolo_id"=&gt;"true", "id"=&gt;"427"}, 
   "3"=&gt;{"articolo_id"=&gt;"0", "id"=&gt;"428"}}, "contractgroup_id"=&gt;"2"}, "commit"=&gt;"Add"}
  </code></pre>
  
  <p>however the controller action is invoking the parameters in a mistaken manner, as no records are being created:</p>
  
  <pre><code>params[:contractgroup][:articolocontractgroups_attributes].each do |id, attrs|
    if params[:articolo_id] == "true"
      @articolocontractgroup = Articolocontractgroup.new
       (articolo_id: params[:contractgroup][:articolo_id], 
        contractgroup_id: params[:contractgroup][:contractgroup_id])
      @articolocontractgroup.save
    end
  end
  </code></pre>
  
  <p>where is this messed up?</p>