class ProfilesController
Manages the signed-in userβs own account: display name, locale, theme, and password. Actions operate on current_user, so no Pundit authorization call is needed.
Public Instance Methods
Source
# File app/controllers/profiles_controller.rb, line 23 def password return render(:show, status: :not_found) if current_user.sso? if current_user.update_with_password(password_params) bypass_sign_in(current_user) redirect_to profile_path, notice: t("profiles.notices.password_updated") else render :show, status: :unprocessable_content end end
Password change is only exposed to local (non-SSO) accounts.
Source
# File app/controllers/profiles_controller.rb, line 11 def show end
Renders the account preferences screen.
Source
# File app/controllers/profiles_controller.rb, line 16 def update return redirect_to(profile_path, notice: t("profiles.notices.updated")) if current_user.update(profile_params) render :show, status: :unprocessable_content end
Account preferences: display name, locale and theme. Password changes go through password so they can require the current password.