Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretender button in MADMIN #187

Closed
custombusinesssystems opened this issue Aug 7, 2022 · 0 comments
Closed

Pretender button in MADMIN #187

custombusinesssystems opened this issue Aug 7, 2022 · 0 comments

Comments

@custombusinesssystems
Copy link

custombusinesssystems commented Aug 7, 2022

Hi Chris,

I am using the rails 7 with jumpstart, and have installed madmin

I wanted to implement pretender and found that you had already done all the ground work

I can't find the a button to impersonate a user on the madmin/users/show or index page so i tried to implement one but i get errors.

if I add the button like so:

  <%= link_to "Login As", resource.impersonate_user_path(@record.id), method: :post %>

I get

undefined method `impersonate_user_path' for UserResource:Class

If I add the button without the resource, i get undefined method `impersonate_user_path' for #ActionView::Base:0x0000000002b2f0

  <%#= link_to "Login As", impersonate_user_path(resource), method: :post %>
  <%= link_to "Edit", resource.edit_path(@record), class: "block bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 px-4 border border-gray-400 rounded shadow" %>
</div>
<%= button_to "Delete", resource.show_path(@record), method: :delete, data: { confirm: "Are you sure?" }, class: "bg-white hover:bg-gray-100 text-red-500 font-semibold py-2 px-4 border border-red-500 rounded shadow pointer-cursor" %>

Could you point me in the right direction here.

Repository owner locked and limited conversation to collaborators Nov 7, 2023
@excid3 excid3 converted this issue into discussion #204 Nov 7, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant