Ask A Question

Notifications

You’re not receiving notifications from this thread.

After adding the activeadmin gem, my previous style changed, How can avoid this?

Larry Qu asked in Gems / Libraries

After adding the activeadmin gem, my previous style changed , How can avoid this?

Previous style is :

After adding the activeadmin gem, the style become this:

but if I comment the active_admin scss out, the admin page will have no style.
active_admin.scss

@import "active_admin/mixins";
@import "active_admin/base";
Reply

Make sure you're not requiring the active admin css file in your application.css on accident (probably with a require_tree). Their CSS is made to be compiled separately into another file out of the box and so you don't want to include their CSS with yours. That's probably happening with a bad require or import in your application.css at the top.

Reply

yes, solved! Thank you !
After I manually require scss files, no longer use require_tree it works fine.

 *= require_self
 * require_tree . // not used
 *
 *= require addresses.scss
 *= require carts.scss
 *= require checkout.scss
 *= require full-width-pics.scss
 *= require order_items.scss
 *= require orders.scss
 *= require products.scss
 *= require scaffolds.scss
 *= require services.scss
 *= require startup.scss
 */
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.