Rails Admin + Devise无法注销

时间:2012-10-24 19:03:39

标签: ruby-on-rails devise routes rails-admin

在真实服务器上部署我的应用程序 Ubuntu + Apache + Passenger 我的网站位于 http://192.168.56.101:8080/sales_bank/public/ 并且所有工作但是当我从位于 http://192.168.56.101:8080/sales_bank/public/admin 的rails admin注销时,我被重定向到 http://192.168.56.101:8080/users/sign_out 但我没有这个溃败我有这个 http://192.168.56.101:8080/sales_bank/public/users/sign_out 。我不明白如何从rails admin log out按钮更改log_out路径。

的routes.rb

mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'

devise_scope :user do
      match "registr" => "devise/registrations#new", as: "reg"
      match "logout" => "devise/sessions#destroy", as: "logout"
      match "users/sign_out" => "devise/sessions#destroy", as: "logout"
    end

1 个答案:

答案 0 :(得分:-1)

我没有登出按钮或任何登录或退出的可能性,我只是解决了它 将此行添加到config / initializers / rails_admin.rb

 config.authenticate_with do
    authenticate_admin!
  end