No release in over a year
Run ActiveAdmin v4 without asset setup.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 4.0.0.beta22, < 5.0.0
 Project Readme

Gem Version Build Status Coverage

ActiveAdminAssets

This gem is for you if you want to be able to run ActiveAdmin v4+ without any asset setup, e.g.:

  • no cssbundling-rails or tailwindcss-rails
  • no sprockets or propshaft
  • no assets:precompile or similar build steps

Caveats

  • This will prevent you from customizing ActiveAdmin's tailwind config, making theming more hacky.
  • This will prevent you from using tailwind classes that are not used by ActiveAdmin itself.

Installation

Add activeadmin_assets to your Gemfile.

Usage

That's it 😁. If you want, you can configure the path to serve static assets from:

ActiveAdminAssets.path = '/x/admin-assets' # default: '/active_admin_assets'

How it works

Like the asset gems of old, this gem includes static copies of all assets that are required to run ActiveAdmin and injects them automatically.

The assets (CSS and JS) are generated automatically when testing or building the gem - see ./Rakefile.

To make the assets available for any rails setup, the gem has a railtie which monkey-patches rails' asset path helpers (URLPatch). This patch changes the CSS and JS paths that are rendered in ActiveAdmin views. The railtie also adds a middleware (Middleware). This middleware detects requests to these custom asset paths and responds to them by serving asset files from the gem.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jaynetics/activeadmin_assets.

License

The gem is available as open source under the terms of the MIT License.