Sha256: 391c5a4b86c9bfef55b7678395d6f48e1c1f9847b5c9f00b1a11b5ef4ef142bb

Contents?: true

Size: 743 Bytes

Versions: 19

Compression:

Stored size: 743 Bytes

Contents

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

  def show
    @messages = current_user.messages || []
    @watched_discussions = current_user.watched_discussions
  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

19 entries across 19 versions & 1 rubygems

Version Path
mumuki-laboratory-5.13.0 app/controllers/users_controller.rb
mumuki-laboratory-5.12.1 app/controllers/users_controller.rb
mumuki-laboratory-5.12.0 app/controllers/users_controller.rb
mumuki-laboratory-5.11.0 app/controllers/users_controller.rb
mumuki-laboratory-5.10.4 app/controllers/users_controller.rb
mumuki-laboratory-5.10.3 app/controllers/users_controller.rb
mumuki-laboratory-5.10.2 app/controllers/users_controller.rb
mumuki-laboratory-5.10.1 app/controllers/users_controller.rb
mumuki-laboratory-5.10.0 app/controllers/users_controller.rb
mumuki-laboratory-5.9.1 app/controllers/users_controller.rb
mumuki-laboratory-5.9.0 app/controllers/users_controller.rb
mumuki-laboratory-5.8.3 app/controllers/users_controller.rb
mumuki-laboratory-5.8.1 app/controllers/users_controller.rb
mumuki-laboratory-5.8.0 app/controllers/users_controller.rb
mumuki-laboratory-5.7.0 app/controllers/users_controller.rb
mumuki-laboratory-5.6.3 app/controllers/users_controller.rb
mumuki-laboratory-5.6.2 app/controllers/users_controller.rb
mumuki-laboratory-5.6.1 app/controllers/users_controller.rb
mumuki-laboratory-5.6.0 app/controllers/users_controller.rb