Sha256: 42e59c905d06bd5649ce646fdce962be47b829db2960ad770d7110c1f0a5b3ec

Contents?: true

Size: 683 Bytes

Versions: 20

Compression:

Stored size: 683 Bytes

Contents

class UsersController < ApplicationController
  before_action :authenticate!
  before_action :set_user!

  def show
    @messages = current_user.messages || []
  end

  def update
    current_user.update_and_notify! user_params
    redirect_to root_path, notice: I18n.t(:user_data_updated)
  end

  def unsubscribe
    user_id = User.unsubscription_verifier.verify(params[:id])
    User.find(user_id).unsubscribe_from_reminders!

    redirect_to root_path, notice: t(:unsubscribed_successfully)
  end

  private

  def validate_user_profile!
  end

  def user_params
    params.require(:user).permit(:first_name, :last_name)
  end

  def set_user!
    @user = current_user
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
mumuki-laboratory-5.5.0 app/controllers/users_controller.rb
mumuki-laboratory-5.4.0 app/controllers/users_controller.rb
mumuki-laboratory-5.3.0 app/controllers/users_controller.rb
mumuki-laboratory-5.2.1 app/controllers/users_controller.rb
mumuki-laboratory-5.2.0 app/controllers/users_controller.rb
mumuki-laboratory-5.1.1 app/controllers/users_controller.rb
mumuki-laboratory-5.1.0 app/controllers/users_controller.rb
mumuki-laboratory-5.0.12 app/controllers/users_controller.rb
mumuki-laboratory-5.0.11 app/controllers/users_controller.rb
mumuki-laboratory-5.0.10 app/controllers/users_controller.rb
mumuki-laboratory-5.0.9 app/controllers/users_controller.rb
mumuki-laboratory-5.0.8 app/controllers/users_controller.rb
mumuki-laboratory-5.0.7 app/controllers/users_controller.rb
mumuki-laboratory-5.0.6 app/controllers/users_controller.rb
mumuki-laboratory-5.0.5 app/controllers/users_controller.rb
mumuki-laboratory-5.0.4 app/controllers/users_controller.rb
mumuki-laboratory-5.0.3 app/controllers/users_controller.rb
mumuki-laboratory-5.0.2 app/controllers/users_controller.rb
mumuki-laboratory-5.0.1 app/controllers/users_controller.rb
mumuki-laboratory-5.0.0 app/controllers/users_controller.rb