Reputation: 4975
I had a good time playing with Active Admin the administrative framework within my application. http://activeadmin.info/
When I installed it I ran
rails g active_admin:install
rake db:migrate
rails g active_admin:resource product
and it generated alot of migrations and code within my application.
My question if I would like to go back and have everything that active_admin put into my application taken out, how would i do so?
Is there one 'rails active_admin:uninstall' command to get rid of everything or do I have to manually create migrations to delete all the tables and search through my code to see what it added?
Upvotes: 33
Views: 17829
Reputation: 41844
Run this in terminal
rails destroy active_admin:install
Remove gem 'activeadmin'
from your gemfile.
Delete the asset files from js and css folders if any remain
Delete any of these lines in Routes.rb
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
ActiveAdmin.routes(self)
Then create a new migration with:
drop_table :active_admin_comments
You may also need:
drop_table :admin_notes
Or rollback the migrations by finding the relevant files MoveAdminNotesToComments
and CreateAdminNotes
in your db/migrate
folder
rake db:migrate:down VERSION=the_version_number
rake db:migrate:down VERSION=the_version_number
Upvotes: 29
Reputation: 487
You also need to delete all the active admin related js and css files in your assets folder after running rails destroy active_admin:install
Upvotes: 1
Reputation: 2742
If you run the following code it should destroy active admin:
rails destroy active_admin:install
rails destroy active_admin:resource product
Upvotes: 44