Rails6 禁用所有非 ActiveAdmin 页面的 ActiveAdmin 布局

Rails6 disable ActiveAdmin layout for all non-ActiveAdmin pages

我的 Rails 6 应用没有 css 或任何样式。我正在使用 Devise,现在我添加了 Active Admin - 结果是 ActiveAdmin 改变了所有页面的外观。如何为非 ActiveAdmin 视图禁用 Active Admin 布局?

ActiveAdmin 添加了这些文件:

app/assets/stylesheets/active_admin.scss

// Sass variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;

// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";

// Overriding any non-variable Sass must be done after the fact.
// For example, to change the default status-tag color:
//
//   .status_tag { background: #6090DB; }

app/assets/javascripts/active_admin.js

// Sass variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;

// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";

// Overriding any non-variable Sass must be done after the fact.
// For example, to change the default status-tag color:
//
//   .status_tag { background: #6090DB; }

我只是引用 ActiveAdmin 陷阱部分

In order to avoid the override of your application style with the Active Admin one, you can do one of these things:

  1. You can properly move the generated file active_admin.scss from app/assets/stylesheets to vendor/assets/stylesheets.
  2. You can remove all require_tree commands from your root level css files, where the active_admin.scss is in the tree.

https://github.com/activeadmin/activeadmin/blob/master/docs/14-gotchas.md#css