我正在启动一个新的Web应用程序,我正在使用Devise进行身份验证.
我让Devise使用注册,登录,编辑和查看用户配置文件.我唯一的问题是点击“删除帐户”只是重定向到/用户,并没有实际删除用户.我究竟做错了什么?
删除帐户按钮
= link_to "Cancel my account",registration_path(resource_name),:confirm => "Are you sure?",:method => :delete
据我所知,我没有改变任何会破坏这一点的东西.我想要使用的删除帐户按钮是
= negative_trash_button_link_to "Cancel my account",:method => :delete,:confirm => "You sure?"
negative_trash_button_link_to位于css3buttons gem中.
编辑:我的routes.rb
resources :posts ActiveAdmin.routes(self) devise_for :admin_users,ActiveAdmin::Devise.config root :to => "home#index" devise_for :users do get "/users/sign_out" => "devise/sessions#destroy",:as => :destroy_user_session end resources :users,:only => :show