Reputation: 1083
I am writing a rails app that is mostly CRUD. I want to have an admin interface so that non-programmers should be able to control the content. I decided to go with the ready-made library rails admin, because it seems to be the one that offers the most of convention > configuration.
Well, mostly everything.
Everytime I run a command that uses the rails configuration (it seems) it halts and gives me a long error. The errors I get in my shells are posted here if you can understand it better than I do.
If I do another rails command, such as rails g model Admin
it fails in the same manner, complaining uninitialized constant Admin (NameError)
.
I was strolling along, whistling and having a jolly time. Created a ruby application, installed Devise and set up the User class with it, scaffolded a few CRUD MVC's, made a few custom controllers-views. I know that the gem 'will_paginate' is in conflict with 'rails_admin', so I removed it from my gemfile and instead went with 'kaminari'.
Erik. No, I'm sure he's great. But rails_admin obviously did not play nice with my app. I suspect this has something to do with me not creating an 'Admin' model before installing the gem. But I can't fix it now, since I get theese errors (and I get errors even if I remove rails_admin from the gemfile, do a bundle
and then try to rails g
).
Upvotes: 3
Views: 5041
Reputation: 3394
Have you removed the rails_admin generated route from config/routes.rb:
devise_for :admins
mount RailsAdmin::Engine => '/rails_admin', :as => 'rails_admin'
That is what is causing Devise to look for an Admin model. Removing that, along with removing the gem and initializer file should remove the whole thing from your project.
Upvotes: 8