Sha256: b869dc007c391beae11f91231888143981c136051279126d95e8c43aa4cd7150

Contents?: true

Size: 453 Bytes

Versions: 6

Compression:

Stored size: 453 Bytes

Contents

class EmailsController < ApplicationController
  def edit
  end

  def update
    if current_user.update_attributes(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

6 entries across 6 versions & 1 rubygems

Version Path
minimalist_authentication-2.1.5 app/controllers/emails_controller.rb
minimalist_authentication-2.1.4 app/controllers/emails_controller.rb
minimalist_authentication-2.1.3 app/controllers/emails_controller.rb
minimalist_authentication-2.1.2 app/controllers/emails_controller.rb
minimalist_authentication-2.1.1 app/controllers/emails_controller.rb
minimalist_authentication-2.1.0 app/controllers/emails_controller.rb