Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby/Rails - Remove ActiveAdmin from my application

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?

like image 214
ChrisWesAllen Avatar asked Oct 17 '11 19:10

ChrisWesAllen


2 Answers

If you run the following code it should destroy active admin:

rails destroy active_admin:install rails destroy active_admin:resource product 
like image 100
tomciopp Avatar answered Sep 20 '22 21:09

tomciopp


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 
like image 36
Abram Avatar answered Sep 16 '22 21:09

Abram