title: Checkbox "NoMethodError" in rails
body: <p>I'm writing a CMS and I faced a problem while making a role management for users. I have a boolean field <code>:admin</code> in my <code>User</code> model, and I've made a checkbox in my form to set created user as an administrator. Here is the <code>users_controller</code>:</p>
  
  <pre><code>def create
    @user = User.create(user_params)
    respond_to do |format|
      if @user.save
        format.html { redirect_to users_path }
        format.json { head :no_content }
      else
        format.html { render :new }
        format.json { render @user.errors, status: :unprocessable_entity }
      end
    end
  end
  
  def edit
  end
  
  def update
    respond_to do |format|
      if @user.update(user_params)
        format.html { redirect_to users_path }
        format.json { head :no_content }
      else
        format.html { render :edit }
        format.json { render @user.errors, status: :unprocessable_entity }
      end
    end
  end
  </code></pre>
  
  <p>and this is my form :</p>
  
  <pre><code>&lt;%= form_for @user do |f| %&gt;
    # Here go fields for username, email and password
    &lt;p&gt;
      &lt;%= f.label "Set as administrator" %&gt; &lt;br /&gt;
      &lt;%= f.hidden_field :admin, '' %&gt; 
      # I also tried with &lt;%= f.hidden_field :admin, false %&gt;
      &lt;%= f.check_box :admin, checked = true %&gt; 
      # Or &lt;%= f.check_box :admin, data: { switch: true } %&gt;
    &lt;/p&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>But any of these options returns me the following:</p>
  
  <pre><code>NoMethodError in Multiflora::Users#edit
  
  undefined method `merge' for "":String
  </code></pre>
  
  <p>What have I done wrong? </p>