From 768d360ce71a3a01800e0dcc55cb69656b1508e9 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Tue, 21 Jun 2022 14:51:22 +0200 Subject: [PATCH] Add profile setting for anon display name --- app/controllers/user_controller.rb | 2 +- app/views/settings/_profile.haml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 080b7c2a..7f5344d3 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -42,7 +42,7 @@ class UserController < ApplicationController end def update_profile - profile_attributes = params.require(:profile).permit(:display_name, :motivation_header, :website, :location, :description) + profile_attributes = params.require(:profile).permit(:display_name, :motivation_header, :website, :location, :description, :anon_display_name) if current_user.profile.update(profile_attributes) flash[:success] = t(".success") diff --git a/app/views/settings/_profile.haml b/app/views/settings/_profile.haml index 42aaf5d0..ce715d75 100644 --- a/app/views/settings/_profile.haml +++ b/app/views/settings/_profile.haml @@ -41,6 +41,8 @@ = f.text_field :motivation_header + = f.text_field :anon_display_name, placeholder: APP_CONFIG[:anonymous_name] + = f.text_field :website = f.text_field :location