ruby-on-rails-4activeadmin

My css file is overridden due to activeadmin


First I have created an active_admin css file as app/assets/stylesheets/active_admin.css.scss

/* active_admin.css.scss */
@import "active_admin/mixins";
@import "active_admin/base";

/* application.css.scss*/
@import "active_admin.css.scss"

So I have a lot of css of mine been overriden, I followed instructions of this post but still doesn't work. I changed files location from app/assets/stylesheets/active_admin.css.scss to vendor/assets/stylesheets/active_admin.css.scss but still having the problem.

So, how can I load activeadmin css files only when needed?


Solution

  • For active_admin to play nice don't include it in the application.css, i.e.: remove the

    require_tree .
    

    and require each file separately inside app/assets/stylesheets but don't put active_admin.css

    and on config/production.rb put this

    config.assets.precompile += ['active_admin.css']