From 09c5d16288750681d9c04c37782966fe78b1dcba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bucsy=20Benj=C3=A1min?= Date: Fri, 23 Dec 2022 18:06:46 +0100 Subject: [PATCH] add dev button to quickly impersonate user --- app/views/profiles/show.html.erb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/profiles/show.html.erb b/app/views/profiles/show.html.erb index 45aee84a..c7d14230 100644 --- a/app/views/profiles/show.html.erb +++ b/app/views/profiles/show.html.erb @@ -31,6 +31,12 @@ <%= im_account.account %> <% end %> <%= @user_presenter.delegated_for %> + <% if Rails.env.development? && current_user.id != @user_presenter.id %> + <%= form_tag(impersonate_user_path) do %> + <%= hidden_field_tag :user_id, @user_presenter.id %> + <%= submit_tag "Impersonate this user", class: 'uk-button uk-button-primary uk-margin-small uk-margin-left' %> + <% end %> + <% end %>