title: Can't update user attributes - Rails and Devise
body: <p>I am using Rails (3.0.9) with Devise (1.5.3) and I have an User model in which the attributes can't be updated for some reason I have no idea about.</p>
  
  <p>The form for this User object has many attributes including those from devise: password and password_confirmation, for example.</p>
  
  <p>When I submit the form I get this in the logger:</p>
  
  <p><code>WARNING: Can't mass-assign protected attributes: current_password</code></p>
  
  <p>But when I add <code>current_password</code> to <code>attr_accessible</code> I get: </p>
  
  <p><code>
  ActiveRecord::UnknownAttributeError at /users
  unknown attribute: current_password
  </code></p>
  
  <p>I am not very into Devise but I think current_password is just a virtual attribute. This error is very annoying, have you any idea on why this is happening? I am clueless.</p>
  
  <p>By the way, my <code>Users::RegistrationsController#update</code> action:</p>
  
  <pre><code>def update
    logger.error "SALMONELLA " + self.resource.password.inspect
  
    self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
  
    #params[:user].delete [:current_password]
  
    if resource.update_attributes(params[:user])
      Resque.enqueue(MdcUpdateUser, resource.id)
      set_flash_message :notice, :updated if is_navigational_format?
      sign_in resource_name, resource, :bypass =&gt; true
      respond_with resource, :location =&gt; after_update_path_for(resource)
    else
      clean_up_passwords(resource)
      respond_with_navigational(resource){ render_with_scope :edit }
    end
  end
  </code></pre>
  
  <p>I've tried using Devise's <code>update_without_password</code> and tried also deleting <code>current_password</code> from the <code>params[:user]</code> hash but had no success.</p>
  
  <p>I appreciate any help you give me. Please ask for any more information if you think there is any information missing in this question.</p>