0

尝试安装活动管理员,但我遇到此错误“无效的路由名称,已在使用:'admin_root'”,所以在我研究了 stackoverflow 之后。我找到了一些答案,试图将它们应用于我的案例,但它不起作用。这是我的路线.rb。我很困惑我应该删除哪些路由来修复问题。我没有任何管理路由。这有点令人困惑。

 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

结尾

4

1 回答 1

2

您正在尝试加载 ActiveAdmin 路由两次。你有这行两次:

ActiveAdmin.routes(self)

删除其中一个实例,您应该一切顺利。

于 2013-10-06T15:22:04.037 回答