Administrate: TypeError in Admin::UsersController#index Admin is not a module

Created on 12 Nov 2015  路  8Comments  路  Source: thoughtbot/administrate

Hi, I am trying to install Administrate for my app, and I got this error when accessing the admin page.

I did $ rails generate administrate:install

Am I missing any step?

Most helpful comment

Would be great if you renamed the namespace to Admins to avoid this. Or, offer the option to customise the namespace name

Thanks!

All 8 comments

uh oh - looks like you have Admin defined somewhere else in your application - likely as a database model. Is that right?

Thats true, I have an Admin model.

ah...

Right now Administrate's admin/ namespace is hard-coded, so it'll be a bit difficult to get it working with your application. I think the best option would be renaming your Admin model to AdminUser or something similar. You can use self.table_name = "admin" in your model to avoid database migrations.

We're still pretty early on in Administrate's lifespan, so we'll definitely address this - it just might take a wile, since we're focusing on stability first.

ok!,

thanks for the fast feedback!!

No problem! Sorry I can't help out more. /=

Would be great if you renamed the namespace to Admins to avoid this. Or, offer the option to customise the namespace name

Thanks!

Or change it to administrate/ to avoid this :)

FYI: This is something we're looking at in #956.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gracewashere picture gracewashere  路  3Comments

stephenson picture stephenson  路  3Comments

ACPK picture ACPK  路  4Comments

steffenix picture steffenix  路  4Comments

conwayanderson picture conwayanderson  路  4Comments