Obed Lorisson
Obed Lorisson

Reputation: 449

Issue with configuring active admin

try to install active admin , but i encounter this error "Invalid route name, already in use: 'admin_root'" so after i research stackoverflow . i found some answers ,trying to apply them to my case but it's not working . here's my routes.rb. im confused which routes should i delete to fix the prob.i don't have any admin routes . it's a little confusing.

 devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  resources :activities, only: [:index, :destroy]
  get "relationships/create"
  get "relationships/destroy"
  get "users/show"
   # You can have the root of your site routed with "root"
  root 'videos#index'

  get 'home',    :to => "pages#home",    :as => :home
  get 'login',   :to => "pages#login",   :as => :login
  get 'about',   :to => "pages#about",   :as => :about
  get 'browse',  :to => "pages#browse",  :as => :browse
  get 'recent',  :to => "videos#recent", :as => :recent 

  devise_for :users
  ActiveAdmin.routes(self)
  get 'users/:id' => 'users#show', as: :user

  resources :relationships, only: [:create, :destroy]
  resources :user_friendships

  resources :videos
  resources :hearts, only: :create
  resources :playlists 

  resources :users do
    resources :playlists do
       resources :videos
    end
    member do
      get :following, :followers
    end

end

Upvotes: 0

Views: 44

Answers (1)

manishie
manishie

Reputation: 5322

You are trying to load the ActiveAdmin routes twice. You have this line twice:

ActiveAdmin.routes(self)

Remove one of those instances and you should be good to go.

Upvotes: 2

Related Questions