简体   繁体   中英

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?

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

rails destroy active_admin:install
rails destroy active_admin:resource product

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

运行 rails destroy active_admin:install 后,您还需要删除资产文件夹中所有与活动管理相关的 js 和 css 文件

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM