title: Rails 5: collection_select not saving
body: <p>My form have collection select but no saving to database
  Form tryings assign player id to "pretender" record</p>
  
  <p><a href="https://i.stack.imgur.com/vam9k.jpg" rel="nofollow noreferrer">https://i.stack.imgur.com/vam9k.jpg</a></p>
  
  <p>database models:</p>
  
  <pre><code> create_table "players", force: :cascade do |t|
      t.string "name"
      t.string "group"
      t.text "info"
      t.datetime "created_at", null: false
      t.datetime "updated_at", null: false
    end
  
    create_table "pretenders", force: :cascade do |t|
      t.string "name"
      t.string "archtype"
      t.string "magic"
      t.string "scale"
      t.integer "player_id"
      t.datetime "created_at", null: false
      t.datetime "updated_at", null: false
    end
  </code></pre>
  
  <p>in form partial:</p>
  
  <pre><code> &lt;div class="field"&gt;
          &lt;%= form.label :player_id %&gt;
          &lt;%= form.collection_select(:player_id, Player.all, :id, :name, {}, {:multiple =&gt; true, :size =&gt; '10'}) %&gt;
        &lt;/div&gt;
  </code></pre>
  
  <p>generated html select options have value but not saving?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>    &lt;select multiple="multiple" size="10" name="pretender[player_id][]"&gt;
      &lt;option value="1"&gt;sy&lt;/option&gt;
      &lt;option value="2"&gt;malakal&lt;/option&gt;
      &lt;option value="3"&gt;pigs go moo&lt;/option&gt;
      &lt;option value="4"&gt;malgrib&lt;/option&gt;
      &lt;option value="5"&gt;Rael&lt;/option&gt;
      &lt;option value="6"&gt;Nargo&lt;/option&gt;
      &lt;option value="7"&gt;salva&lt;/option&gt;
      &lt;option value="8"&gt;pbiecub&lt;/option&gt;
      &lt;option value="9"&gt;Jude&lt;/option&gt;
      &lt;option value="10"&gt;Cirno&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>here params at pretender controller:</p>
  
  <pre><code>def pretender_params
    params.require(:pretender).permit(:name, :archtype, :magic, :scale, :player_id)
    params.require(:pretender).permit(:id)
  end
  </code></pre>
  
  <p>Am attempt solution at:
  <a href="https://stackoverflow.com/questions/44015135/collection-select-not-saving">Collection_select not saving</a>
  &amp; other pages, but site won't let me post more links lol</p>