title: Devise authenticating with username instead of email
body: <p>I'm new to Devise and have it working fine by using an email address as the authentication key.  However, I have a use case which requires a username instead and I can't seem to get it working.</p>
  
  <p>I've added a string column, "username" to the users table, changed the fields from :email to :username in the sign-in form, and have changed the authentication key in devise.rb to :username yet when I go to sign in I'm met with this prompt: "Please enter an email address".</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>**new.html.erb**
  
    &lt;div&gt;&lt;%= f.label :username %&gt;&lt;br /&gt;
    &lt;%= f.email_field :username %&gt;&lt;/div&gt;
  
  **User.rb**
  class User &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable,
           :recoverable, :rememberable, :trackable, :validatable, :authentication_keys =&gt; [:username]
  
    # Setup accessible (or protected) attributes for your model
    attr_accessible :email, :password, :password_confirmation, :remember_me, :username
    # attr_accessible :title, :body
  end
  
  **devise.rb**
   config.authentication_keys = [ :username ]
  </code></pre>