title: How to update only email using devise?
body: <p>I am trying to update only email using this form, but validation is failing <code>Current password can't be blank</code>, requires password_confirmation, I don't have a clue how to void this requirement</p>
  
  <pre><code> &lt;%= form_for(resource, :as =&gt; resource_name, :url =&gt; registration_path(resource_name), :html =&gt; {:method =&gt; :put, :id=&gt;"email_form"}) do |f| %&gt;
              &lt;%= devise_error_messages! %&gt;
              &lt;div&gt;&lt;%= f.label :email %&gt;
                &lt;br/&gt;
                &lt;%= f.email_field :email, :autofocus =&gt; true %&gt;&lt;/div&gt;
              &lt;div&gt;&lt;%= f.submit "Update" %&gt;&lt;/div&gt;
          &lt;% end %&gt;
  </code></pre>
  
  <p><strong>UPDATE</strong>
  This is my update action in the overrided controller RegistrationsController &lt; Devise::RegistrationsController</p>
  
  <pre><code>class RegistrationsController &lt; Devise::RegistrationsController
    def update
      @user = User.find(current_user.id)
  
      successfully_updated = if needs_password?(@user, params)
        @user.update_with_password(params[:user])
      else
        # remove the virtual current_password attribute update_without_password
        # doesn't know how to ignore it
        params[:user].delete(:current_password)
        @user.update_without_password(params[:user])
      end
  
      if successfully_updated
        set_flash_message :notice, :updated
        # Sign in the user bypassing validation in case his password changed
        sign_in @user, :bypass =&gt; true
        redirect_to after_update_path_for(@user)
      else
        render "edit"
      end
    end
  
    private
    def needs_password?(user, params)
      user.email != params[:user][:email] ||
        params[:user][:password].present?
    end
  end
  </code></pre>