Setting root page to activeAdmin default login page

Gerson Scanapieco picture Gerson Scanapieco · Jun 18, 2012 · Viewed 13.2k times · Source

Im having dificulty in setting the root page in may Rails app to the default login page of the Active Admin gems, at localhost:3000/admin/login. Here's my routes.rb:

TestActiveadmin::Application.routes.draw do
  ActiveAdmin.routes(self)

  devise_for :admin_users, ActiveAdmin::Devise.config

  match 'login' => 'sessions#new', :as => :login
  match 'signup' => 'users#new', :as => :signup
  match 'logout' => 'sessions#destroy', :as => :logout
  resources :sessions
  resources :users

end

What should I do?

Answer

Jesse Wolgamott picture Jesse Wolgamott · Jun 18, 2012

Tell rails you want the default root to go to the admin namespace, dashboard controller, index action:

root to: "admin/dashboard#index"