在ActiveAdmin中更改Root

时间:2013-07-16 09:10:06

标签: ruby-on-rails ruby-on-rails-3 activeadmin

现在我在Rails中的active_admin gem有一个默认网址

www.home.com/admin

但是活跃的管理员位于

www.home.com/group/admin

我如何才能使活动管理员中的每个链接都路由到/ group / admin / [next link]

我在下面尝试了Gmat的解决方案,这就是发生的事情:

  

new_group_admin_user_session GET /group/admin/login(.:format)   active_admin /色器件/会话#新               group_admin_user_session POST /group/admin/login(.:format)
  active_admin /色器件/会话#创建       destroy_group_admin_user_session删除|获取/group/admin/logout(.:format)
  active_admin /色器件/会话#销毁              group_admin_user_password POST /group/admin/password(.:format)
  active_admin /设计/密码#创建          new_group_admin_user_password GET /group/admin/password/new(.:format)
  active_admin /色器件/密码#新         edit_group_admin_user_password GET /group/admin/password/edit(.:format)
  active_admin /色器件/密码#编辑                                              PUT /group/admin/password(.:format)
  active_admin /色器件/密码#更新                       group_admin_root /group/admin(.:format)group / admin / dashboard #index                             group_root /group(.:format)group / dashboard #index         batch_action_group_admin_leads POST /group/admin/leads/batch_action(.:format)
  组/管理/领导#batch_action                      group_admin_leads GET /group/admin/leads(.:format)
  组/管理/领导#指数                                              POST /group/admin/leads(.:format)
  组/管理/领导#创建                   new_group_admin_lead GET /group/admin/leads/new(.:format)group / admin / leads #new                  edit_group_admin_lead GET /group/admin/leads/:id/edit(.:format)group / admin / leads#edit                       group_admin_lead GET /group/admin/leads/:id(.:format)group / admin / leads #show                                              PUT /group/admin/leads/:id(.:format)
  组/管理/领导#更新                                              删除/group/admin/leads/:id(.:format)
  capstonemlg /管理/领导#销毁                  group_admin_dashboard /group/admin/dashboard(.:format)
  组/管理/仪表板#索引

我为格式化道歉。重点是所有链接www.home.com/group/[anything都被破坏了。

2 个答案:

答案 0 :(得分:1)

试试这个:

# config/routes.rb
namespace :group do
  ActiveAdmin.routes(self)
end

答案 1 :(得分:1)

我认为您还需要自定义ActiveAdmin命名空间。

http://www.activeadmin.info/docs/2-resource-customization.html

ActiveAdmin.register Post, :namespace => "groups/admin"