Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting root page to activeAdmin default login page

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?

like image 543
Gerson Scanapieco Avatar asked Jun 18 '12 16:06

Gerson Scanapieco


2 Answers

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

root to: "admin/dashboard#index" 
like image 179
Jesse Wolgamott Avatar answered Sep 19 '22 01:09

Jesse Wolgamott


You can edit the Active Admin config file: config/initializers/active_admin.rb

config.root_to = 'admin/dashboard#index' 
like image 21
James Zhang Avatar answered Sep 22 '22 01:09

James Zhang