Sha256: 96fc8f33af2cc490ef3ffb8f0714c73463aca1eff09e796240808447884786dd

Contents?: true

Size: 442 Bytes

Versions: 7

Compression:

Stored size: 442 Bytes

Contents

class EmailsController < ApplicationController
  def edit
  end

  def update
    if current_user.update(user_params)
      redirect_to update_redirect_path, notice: 'Email successfully updated'
    else
      render :edit
    end
  end

  private

  def user_params
    params.require(:user).permit(:email)
  end

  def update_redirect_path
    current_user.needs_email_verification? ? new_email_verification_path : dashboard_path
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
minimalist_authentication-2.4.0 app/controllers/emails_controller.rb
minimalist_authentication-2.3.0 app/controllers/emails_controller.rb
minimalist_authentication-2.2.4 app/controllers/emails_controller.rb
minimalist_authentication-2.2.3 app/controllers/emails_controller.rb
minimalist_authentication-2.2.2 app/controllers/emails_controller.rb
minimalist_authentication-2.2.1 app/controllers/emails_controller.rb
minimalist_authentication-2.2.0 app/controllers/emails_controller.rb