From 4638b69fda80df4ed20641dbd7c39d6bf58a20e5 Mon Sep 17 00:00:00 2001 From: Miguel Michelson Date: Fri, 11 Aug 2023 11:29:23 -0400 Subject: [PATCH] become redirect & menu avatar --- app/controllers/application_controller.rb | 1 + app/views/shared/_user_menu.html.erb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ba43ece..b739da2 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,6 +9,7 @@ def become if current_user.is_admin? user = User.find(params[:id]) sign_in(:user, user) + redirect_to root_url, notice: "logged in as #{user.username}" else redirect_to root_url, error: "not allowed" end diff --git a/app/views/shared/_user_menu.html.erb b/app/views/shared/_user_menu.html.erb index dfe6e21..9a5a824 100644 --- a/app/views/shared/_user_menu.html.erb +++ b/app/views/shared/_user_menu.html.erb @@ -154,7 +154,7 @@ > <%= gettext("Notifications") %> - <% #= image_tag(current_user, :small) %> + <%= image_tag(current_user.avatar_url(:small), class: "h-6 w-6 rounded-full") %>