gregbell/active_admin — pull request #1791 by quark-zju (2013-03-19 15:46:39+00:00)
Title: Signing out redirects incorrectly when activeadmin route is scoped

If active admin route is scoped, like

```ruby
scope :path => '/foo' do
ActiveAdmin.routes(self)
end
```

Then devise sign out action will redirect to '/admin', where it should be '/foo/admin'.

This is because in `lib/active_admin/devise.rb`, there are some hardcoded urls:

```ruby
def root_path
if ActiveAdmin.application.default_namespace
"/#{ActiveAdmin.application.default_namespace}"
else
"/"
end
end
```

It may be fixed by change these lines to

```ruby
def root_path
root_path_method = [ActiveAdmin.application.default_namespace, :root_path].join('_')
respond_to?(root_path_method) ? send(root_path_method) : '/'
end
```

I am somehow busy these days. I will write test for this and commit fix later.