title: Devise change email does not update email
body: <p>I'm trying to allow users to change their email addresses which devise uses as their unique username. Even though the update gives no errors, no change is made to the email address for the user in the database. </p>
  
  <p>Here are the relevant portions of code:</p>
  
  <p>Form:</p>
  
  <pre><code>&lt;%= f.fields_for :user_account, @user.user_account do |user_account| %&gt; 
  &lt;p&gt;Edit email address for account: &lt;%=  @user.user_account.email %&gt;&lt;/p&gt; 
  &lt;div class="field"&gt;
    &lt;%= user_account.label :new_email %&gt;&lt;br /&gt;
    &lt;%= user_account.text_field :email, autocomplete: "off", value: nil %&gt;
  &lt;/div&gt;
  &lt;div class="field"&gt;
    &lt;%= user_account.label :password %&gt; &lt;i&gt;(please confirm the password associated with this account)&lt;/i&gt;&lt;br /&gt;
    &lt;%= user_account.password_field :current_password, autocomplete: "off" %&gt;
  &lt;/div&gt;
  &lt;%= hidden_field_tag 'form', 'email' %&gt;
  &lt;div class="actions"&gt;
    &lt;%= user_account.submit "Edit" %&gt;
  &lt;/div&gt;
  </code></pre>
  
    
  
  <p>controller:</p>
  
  <pre><code>def update
  respond_to do |format|
  if params[:form] == 'email'
      if @user.user_account.valid_password?(params[:user][:user_account_attributes][:current_password])
        if @user.update(user_params)
          format.html { redirect_to user_path(@user), :notice =&gt; 'your new email has been saved' }
          format.json { render :show, status: :ok, location: @user }
        else
          format.html { render :edit }
          format.json { render json: @user.errors, status: :unprocessable_entity }
        end
      else 
        format.html { redirect_to edit_email_path(@user), :notice =&gt; 'incorrect password (email)' }
      end 
  else ...
  </code></pre>
  
  <p>the user_params method: </p>
  
  <pre><code>def user_params
  params.require(:user).permit(
    :first_name, :middle_initial, :last_name, 
    :linkedin, :website, :facebook, :video, :phone_number, 
    :address_1, :address_2, :city, :zip_code, 
    :image, :number, :years_practicing, :neighborhood, :biography, :price, :status,
    user_employments_attributes: [:id, :user_id, :company, :position, :start_date, :end_date, :info, :_destroy], 
    user_educations_attributes: [:id, :user_id, :school, :degree_title, :start_date, :end_date, :info, :_destroy], 
    user_account_attributes: [:id, :user_id, :email, :password, :password_confirmation, :_destroy], 
    user_category_ids:[])
  end
  </code></pre>
  
  <p>user account model: </p>
  
  <pre><code> class UserAccount &lt; ActiveRecord::Base
    # Include default devise modules. Others available are:
    # , :lockable, :timeoutable and :omniauthable
    devise :database_authenticatable, :registerable, :confirmable,
       :recoverable, :rememberable, :trackable, :validatable
     belongs_to :user
   end
  </code></pre>