Sha256: e4eae9251e9016325aaccc669cdaaf74de918e61095426463c2a411ffe80d09b

Contents?: true

Size: 456 Bytes

Versions: 9

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

class EmailsController < ApplicationController
  def edit; end

  def update
    if current_user.update(user_params)
      redirect_to update_redirect_path, notice: t(".notice")
    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

9 entries across 9 versions & 1 rubygems

Version Path
minimalist_authentication-3.1.0 app/controllers/emails_controller.rb
minimalist_authentication-3.0.0 app/controllers/emails_controller.rb
minimalist_authentication-2.7.0 app/controllers/emails_controller.rb
minimalist_authentication-2.6.2 app/controllers/emails_controller.rb
minimalist_authentication-2.6.1 app/controllers/emails_controller.rb
minimalist_authentication-2.6.0 app/controllers/emails_controller.rb
minimalist_authentication-2.5.2 app/controllers/emails_controller.rb
minimalist_authentication-2.5.1 app/controllers/emails_controller.rb
minimalist_authentication-2.5.0 app/controllers/emails_controller.rb