配置活动管理员的问题

时间:2013-10-06 14:55:18

标签: ruby-on-rails

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

 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

1 个答案:

答案 0 :(得分:2)

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

ActiveAdmin.routes(self)

删除其中一个实例,你应该好好去。