32

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?

4

3 回答 3

44

如果您运行以下代码,它应该会破坏活动管理员:

rails destroy active_admin:install
rails destroy active_admin:resource product
于 2011-10-17T20:16:30.430 回答
28

在终端中运行它

rails destroy active_admin:install

gem 'activeadmin'从您的 gemfile 中删除。

从 js 和 css 文件夹中删除资产文件(如果有的话)

删除 Routes.rb 中的任何这些行

  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)
  ActiveAdmin.routes(self)

然后创建一个新的迁移:

  drop_table :active_admin_comments

您可能还需要:

  drop_table :admin_notes

或者通过在您的文件夹中查找相关文件MoveAdminNotesToComments来回滚迁移CreateAdminNotesdb/migrate

rake db:migrate:down VERSION=the_version_number
rake db:migrate:down VERSION=the_version_number
于 2013-09-23T20:07:51.257 回答
1

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

于 2015-09-25T21:14:12.537 回答