Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
syafiqfaiz opened this issue Nov 12, 2015 · 8 comments
Closed

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

syafiqfaiz opened this issue Nov 12, 2015 · 8 comments

Comments

@syafiqfaiz
Copy link

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?

@c-lliope
Copy link
Contributor

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

@syafiqfaiz
Copy link
Author

Thats true, I have an Admin model.

@c-lliope
Copy link
Contributor

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.

@syafiqfaiz
Copy link
Author

ok!,

thanks for the fast feedback!!

@c-lliope
Copy link
Contributor

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

@Bodacious
Copy link

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

Thanks!

@austin-bradley
Copy link

Or change it to administrate/ to avoid this :)

@nickcharlton
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants