开发者

How to remove a user with Devise and CanCan

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜