Sha256: c7e2fefc6a35f31b38347e8ce52657f69c9c94d6a2abd4219706ec8485686460

Contents?: true

Size: 578 Bytes

Versions: 27

Compression:

Stored size: 578 Bytes

Contents

module EgovUtils
  class CurrentUsersController < ApplicationController
    before_action :require_login

    def edit; end

    def update
      current_user.update(update_params)

      if current_user.valid?
        redirect_to edit_current_user_path, notice: t('activerecord.successful.messages.updated', model: User.model_name.human)
      else
        render :edit
      end
    end

    private

    def update_params
      params
        .require(:user)
        .permit(:email, :password, :password_confirmation, :firstname,
                :lastname)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
egov_utils-1.4.0 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.3.0 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.2.4 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.2.3 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.2.2 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.2.1 app/controllers/egov_utils/current_users_controller.rb
egov_utils-1.2.0 app/controllers/egov_utils/current_users_controller.rb