Active admin will not accept my route

I have some problems running routes for my application.

1.

I want to point the active administrator to http://admin.lvh.mehaps000/ I tried to use this code, but it only displays the index page.

# config/routes.rb
scope :admin, constraints: { subdomain: "admin" } do
  ActiveAdmin.routes(self)
  devise_for :admin_users, ActiveAdmin::Devise.config.merge(path: "/")
end

# config/initializers/active_admin.rb
config.default_namespace = :admin

The only URL that works is: http : //admin.lvh.mehaps000/admin Can I avoid it /admin?

2.

Each exam in my application has many parts. I want to add a detail button for each exam using this code.

# app/admin/exams.rb
ActiveAdmin.register Exam do
  # ...
  index do
    column :actions do |exam|
      link_to "Part", admin_exam_parts_path(exam)
    end

    default_actions
  end
  # ...
end

The problem is that it admin_exam_parts_pathdoes not exist.

# config/routes.rb
scope :admin, constraints: { subdomain: "admin" } do
  resources :exams do
    resources :parts
  end

  ActiveAdmin.routes(self)
  devise_for :admin_users, ActiveAdmin::Devise.config.merge(path: "/")
end

rake routes | grep /admin/exams/:exam_id/partsreturns nothing. What am I doing wrong?

I run

  • active admin 0.5.1
  • rails 3.2.12
  • ruby 1.9.3
+5
source
2

. rb

root to: "admin/dashboard#index"

devise_for, !

!

0

"admin" - .

:

ActiveAdmin.register Exam, :namespace => false  do
  ...
end

has_many: :parts, Parts? , , . , ,

0

All Articles