Pujan Soni
Pujan Soni

Reputation: 165

Logout path not working in activeadmin even after modifying the path in active_admin.rb

In my admin panel the logout link is not working. In my project I have removed the default admin user that is generated while installing the active admin and used the role from profile model to sign in as super_admin. My logout link is not working though. My /config/initializers/active_admin.rb is:

...
config.logout_link_path = :destroy_user_session_path
config.logout_link_method = :delete
...

My routes.rb file is given as:

Rails.application.routes.draw do
  # Devise routes for registration, session and manual routes for confirmation and password
  devise_for :users, controllers: {
      confirmations: "users/confirmations",
      passwords: "users/passwords"
  } do
    root to: "devise/sessions#new"
    get '/users/sign_out', :to => 'devise/sessions#destroy'
  end
  # Route for super admin
  ActiveAdmin.routes(self)
end

Thanks in advance for your input!!!

Upvotes: 1

Views: 487

Answers (1)

Pujan Soni
Pujan Soni

Reputation: 165

I got my logout link working by adding the active_admin.js file as I have deleted the file initially, as I thought it was not doing anything.

Upvotes: 1

Related Questions