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.
scope :admin, constraints: { subdomain: "admin" } do
ActiveAdmin.routes(self)
devise_for :admin_users, ActiveAdmin::Devise.config.merge(path: "/")
end
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.
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.
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
source