title: How to implement Carrierwave's "Removing uploaded files"?
body: <p>I'm trying to implement Carrierwave's <a href="https://github.com/carrierwaveuploader/carrierwave" rel="nofollow">Removing uploaded files</a>. Although uploading itself works correctly, removing the image/logo does not work. As Carrierwave suggested I add a checkbox to my view to remove the uploaded logo. So I have in my view page:</p>
  
  <pre><code>    &lt;div class="logo"&gt;
        &lt;%= f.label :logo %&gt;
        &lt;%= f.file_field :logo, accept: 'image/jpeg,image/gif,image/png', style: "width:100%" %&gt;
  
        &lt;p&gt;
          &lt;label&gt;
            &lt;%= f.check_box :remove_logo %&gt;
            Remove logo
          &lt;/label&gt;
        &lt;/p&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>I think by adding this checkbox, removing the logo is now already supposed to work. However, checking the box and then submitting the form does not remove the logo (it does not generate an error message either). The server says:</p>
  
  <pre><code>Started PATCH "/users/fakename11"
  Processing by UsersController#update as HTML
  Parameters: {"utf8"=&gt;"✓", "authenticity_token"=&gt;"eR3XCiW***Oge0w==", "user"=&gt;{"fullname"=&gt;"Natasha Pacocha", "email"=&gt;"example@example.com", "password"=&gt;"[FILTERED]", "password_confirmation"=&gt;"[FILTERED]", "remove_logo"=&gt;"1", "organization"=&gt;"Bartoletti-Bins", ...etc...}, "commit"=&gt;"Save changes", "id"=&gt;"fakename11"}
  Unpermitted parameter: remove_logo
  </code></pre>
  
  <p>I'm not sure what to make of the <code>unpermitted parameter</code>. I've tried adding <code>attr_accessor :remove_logo</code> to the controller as well as the user model, but this made no difference.</p>
  
  <p>The gem also speaks of <code>@user.remove_logo!</code> and <code>@user.save</code>. So I tried also adding them in the update method in the controller, as shown below. But this made no difference. What am I doing wrong?</p>
  
  <pre><code>  def update
      @user = User.friendly.find(params[:id])
      if @user.update_attributes(update_params)
        if params[:remove_logo]
          @user.remove_logo!
          @user.save
        end
        flash[:success] = "Profile updated"
        redirect_to @user
      else
        render 'edit'
      end
    end
  
  def update_params
      params.require(:user).permit(:email,
                                   :fullname,
                                   :website, 
                                   :logo
                                   :password, 
                                   :password_confirmation)
  end
  </code></pre>