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?
Based on seanlinsley comment on selected answer and nathan's answer too,
it seems to me that the 'cleanest' way is indeed to move active_admin.css.scss from app/assets/stylesheets/ to vendor/assets/stylesheets/.
No need to any other (configuration) modification: 'main' app has it's styles back to normal and AA display is normal too.
(I didn't want to manually include each of my ressources instead of require_tree ... !)
This is the way AA is getting into: AA (still) opened issue on the matter.
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']
What worked for me (Rails 5) was adding the following line on my app/assets/stylesheets/application.css after the *= require_self line:
*= stub "active_admin"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With