title: Strong Parameters : Hash param is missing or the value is empty
body: <p>I have a form where I have a table with checkboxes in order to select rows and save IDs in my DB.</p>
  
  <p>But it throws me an error:</p>
  
  <blockquote>
    <p>Param is missing or the value is empty: leadallocation"</p>
  </blockquote>
  
  <p>I tried different ways but still nor working. So at the moment I just wand to save the hash in my db. Thanks.</p>
  
  <pre><code># Never trust parameters from the scary internet, only allow the white list through.
  def leadallocation_params
    params.require(:leadallocation).permit(:campaign_id, :company_id, :user_id)
  end
  </code></pre>
  
  <p>Request Parameters:</p>
  
  <pre><code>{"utf8"=&gt;"✓",
   "authenticity_token"=&gt;"GruGL758jT4FO+t/BTRGLrD2uCGOj/qUCrB5VswquzR9N7JZ/rouLmGZnTE7A+XTARiLwkOy1n3/zMqhzuenmg==",
   "company_ids"=&gt;["38",
   "40"],
   "commit"=&gt;"Create Leadallocation"}
  </code></pre>
  
  <p>The controller</p>
  
  <pre><code>class LeadallocationsController &lt; ApplicationController
    before_action :set_leadallocation, only: [:show, :edit, :update, :destroy]
  
    # GET /leadallocations
    # GET /leadallocations.json
    def complete
    end
  
  
    def index
      @leadallocations = Leadallocation.all
    end
  
    # GET /leadallocations/1
    # GET /leadallocations/1.json
    def show
    end
  
    # GET /leadallocations/new
    def new
  
  
      @leadallocation = Leadallocation.new
      @comps =  Company.all
    end
  
    # GET /leadallocations/1/edit
    def edit
    end
  
    # POST /leadallocations
    # POST /leadallocations.json
    def create
  
      @leadallocation = Leadallocation.new(leadallocation_params)
  
      @leadallocation.company_id = params[:company_ids]
  
  
      respond_to do |format|
        if @leadallocation.save
          format.html { redirect_to @leadallocation, notice: 'Leadallocation was successfully created.' }
          format.json { render :show, status: :created, location: @leadallocation }
        else
          format.html { render :new }
          format.json { render json: @leadallocation.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # PATCH/PUT /leadallocations/1
    # PATCH/PUT /leadallocations/1.json
    def update
      respond_to do |format|
        if @leadallocation.update(leadallocation_params)
          format.html { redirect_to @leadallocation, notice: 'Leadallocation was successfully updated.' }
          format.json { render :show, status: :ok, location: @leadallocation }
        else
          format.html { render :edit }
          format.json { render json: @leadallocation.errors, status: :unprocessable_entity }
        end
      end
    end
  
    # DELETE /leadallocations/1
    # DELETE /leadallocations/1.json
    def destroy
      @leadallocation.destroy
      respond_to do |format|
        format.html { redirect_to leadallocations_url, notice: 'Leadallocation was successfully destroyed.' }
        format.json { head :no_content }
      end
    end
  
    private
      # Use callbacks to share common setup or constraints between actions.
      def set_leadallocation
        @leadallocation = Leadallocation.find(params[:id])
      end
  
      # Never trust parameters from the scary internet, only allow the white list through.
      def leadallocation_params
        params.require(:leadallocation).permit(:campaign_id, :company_id, :user_id)
      end
  end
  </code></pre>
  
  <p>The models</p>
  
  <pre><code>class Leadallocation &lt; ActiveRecord::Base
    belongs_to :campaign
    belongs_to :company
    belongs_to :user
  end
  
  class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :confirmable, :lockable, :timeoutable and :omniauthable
    has_many :activities
    belongs_to :campaign
    has_many :leadallocations
  
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable
  end
  
  class Company &lt; ActiveRecord::Base
    belongs_to :campaign
    has_many :subsidiaries
    has_many :leadallocations
  end
  
  class Campaign &lt; ActiveRecord::Base
    belongs_to :client
    has_many :leads
    has_many :activities
    has_many :contacts
    has_many :users
  has_many :leadallocations
  
  end
  </code></pre>
  
  <p>Routes.rb</p>
  
  <pre><code>resources :leadallocations
  </code></pre>
  
  <p>The view</p>
  
  <pre><code>    &lt;h1&gt;New Leadallocation&lt;/h1&gt;
  
  &lt;p id="notice"&gt;&lt;%= notice %&gt;&lt;/p&gt;
  
  &lt;h1&gt;Listing Companies&lt;/h1&gt;
  &lt;%= simple_form_for(@leadallocation) do |f| %&gt;
  
  &lt;table class="table table-bordered"&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;&lt;/th&gt;
        &lt;th&gt;Name&lt;/th&gt; 
        &lt;th&gt;Country&lt;/th&gt;
        &lt;th colspan="3"&gt;&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
  
    &lt;tbody&gt;
      &lt;% @comps.each do |company| %&gt;
        &lt;tr&gt;
        &lt;td&gt;&lt;%= check_box_tag "company_ids[]", company.id %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= company.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= company.country %&gt;&lt;/td&gt;
  
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;br&gt;
  &lt;div class="form-actions"&gt;
      &lt;%= f.button :submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  &lt;%= link_to 'Back', leadallocations_path %&gt;
  </code></pre>