title: Rails 5 form_for with checkbox array
body: <p>I am using a PostgreSQL database and Rails 5.0.6.
  I try to build a course allocation WebApp for the school where I am working. For each course the teachers are able to select which forms are allowed to visit the course.</p>
  
  <p>Migration file:</p>
  
  <pre><code>  def up
      create_table :courses do |t|
        t.integer :number, null: false
        t.string :name, null: false
        t.text :description, null: false
        t.decimal :level, array: true, default: []
        t.integer :max_visitor, null: false
        t.integer :min_visitor
        t.integer :pos_visit
        t.timestamps
      end
    end
  </code></pre>
  
  <p>In my Controller:</p>
  
  <pre><code>    params.require(:course).permit(:number, :name, :description, :level [], :max_visitor, :min_visitor, :pos_visits)
  </code></pre>
  
  <p>I already read this post: <a href="https://stackoverflow.com/questions/38442592/rails-5-strong-params-with-an-array-within-check-boxes-values">Rails 5 strong params with an Array within check boxes values</a>. But the Syntax <code>params.require(:product).permit(:id, **category_ids: []**)</code> doesnt work for me even though I am using rails 5 as well. I am not sure if <code>:level []</code> really works but it seems to be correct syntax.</p>
  
  <p>This is my Form:</p>
  
  <pre><code>&lt;%= form_for @course do |t| %&gt;
              &lt;%= t.text_field :number, class: 'form-control' %&gt;
              &lt;%= t.text_field :name, class: 'form-control' %&gt;
              &lt;%= t.text_area :description, class: 'form-control' %&gt;
              &lt;%= t.check_box :level[], 1%&gt;
              &lt;%= t.check_box :level[], 2%&gt;
              &lt;%= t.check_box :level[], 3%&gt;
              &lt;%= t.check_box :level[], 4%&gt;
              &lt;%= t.text_field :max_visitor, class: 'form-control' %&gt;
              &lt;%= t.text_field :min_visitor, class: 'form-control' %&gt;
              &lt;%= t.text_field :pos_visit, class: 'form-control' %&gt;&lt;br/&gt;
          &lt;%= t.submit "bestätigen", class: "btn btn-success"%&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>This check_box syntax seems to be wrong.
  May anyone help me with the right syntax of the check_boxes?
  Thanks for help.</p>