17

By default, ActiveAdmin is running under /admin. Is there any way change that?

santschi
  • 231
  • 2
  • 9
  • See if this helps at all: https://github.com/gregbell/active_admin/blob/master/docs/1-general-configuration.md#namespaces – AJcodez Jul 27 '12 at 17:55

3 Answers3

34

Yes. You need to add the following line to the config/initializers/active_admin.rb file:

config.default_namespace = :your_desired_namespace

This will create a http://yourdomain.name/your_desired_namespace

Do note, that you will need to update your routes accordingly (i.e admin_user_path will become your_desired_namespace_user_path).

Amir
  • 1,882
  • 17
  • 22
16

Alternatively to @Amir answer. If you don't care about the exact path, and just want to change the route to something less obvious without needing to change your routes. On the routes file you can just call ActiveAdmin like:

Rails.application.routes.draw do
  scope 'something-else' do
    ActiveAdmin.routes(self)
    get '/', to: 'admin/dashboard#index'
  end
end

Then your routes would be /something-else/admin and you could access the dashboard on /something-else.

And you could still use the regular helpers like admin_user_path.

Zequez
  • 3,399
  • 2
  • 31
  • 42
5

Just for further reference, if you want to run ActiveAdmin from the root path as a standalone app, use this:

config.default_namespace = false
alf
  • 18,372
  • 10
  • 61
  • 92