简体   繁体   中英

Rails Admin + Devise can't log out

After deploying my app on real server Ubuntu + Apache + Passenger my site located there http://192.168.56.101:8080/sales_bank/public/ and all works but when i log out from rails admin located http://192.168.56.101:8080/sales_bank/public/admin i redirected to http://192.168.56.101:8080/users/sign_out but i haven't this rout i have this http://192.168.56.101:8080/sales_bank/public/users/sign_out . I don't understand how i can change log_out path from rails admin log out button.

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

I didn't have my log out button or any possibility to sign in or sign out and I solved it just by adding this line to config/initializers/rails_admin.rb

 config.authenticate_with do
    authenticate_admin!
  end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM