开发者

How to remove a user with Devise and CanCan

开发者 https://www.devze.com 2023-04-05 17:10 出处:网络
As the title states, I want to make it so that an admin may delete a user by clicking on a link that is on their show.html.erb page.

As the title states, I want to make it so that an admin may delete a user by clicking on a link that is on their show.html.erb page.

This is made much more difficult than it should be by devise, or maybe I just don't know enough

I have the code <%=link_to_if(can?(:manage, :all), 'Delete', user_path(@user_on_page), :id=>'delete', :confirm=>'Are you sure you want to delete this user?', :method=>:delete){}%> on the show.html开发者_开发百科.erb page, however when I click on this link from an admin account, i just get a 404 error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号