[英]Ruby/Rails - Remove ActiveAdmin from my application
I had a good time playing with Active Admin the administrative framework within my application.我在我的应用程序中使用 Active Admin 管理框架玩得很开心。 http://activeadmin.info/ 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?我的问题是,如果我想返回并取出 active_admin 放入我的应用程序中的所有内容,我该怎么做?
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?是否有一个“rails active_admin:uninstall”命令可以删除所有内容,还是我必须手动创建迁移以删除所有表并搜索我的代码以查看它添加了什么?
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.从您的 gemfile 中删除gem 'activeadmin'
。
Delete the asset files from js and css folders if any remain如果还有剩余,请从 js 和 css 文件夹中删除资产文件
Delete any of these lines in Routes.rb删除 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或者通过在db/migrate
文件夹中找到相关文件MoveAdminNotesToComments
和CreateAdminNotes
来回滚db/migrate
rake db:migrate:down VERSION=the_version_number
rake db:migrate:down VERSION=the_version_number
运行 rails destroy active_admin:install 后,您还需要删除资产文件夹中所有与活动管理相关的 js 和 css 文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.