Gotchas
Security
Spreadsheet applications vulnerable to unescaped CSV data
If your CSV export includes untrusted data from users, that data may contain an executable formula that can call arbitrary commands on your computer. See #4256 for more details.
Session Commits & Asset Pipeline
When you configure the asset pipeline, make sure the asset prefix (config.assets.prefix) differs from the ActiveAdmin namespace (the default is /admin). If they match, Sprockets will not commit the session. Flash messages will not work, and the session cannot store data.
For more information see the following post.
Helpers
These helper issues have separate workarounds.
Helpers are not reloading in development
This is a known, open issue. Restart your server each time you change a helper.
Helpers may not be included by default
If you set config.action_controller.include_all_helpers = false in your application configuration, include the helper manually.
Solutions
Use an override
This applies to all ActiveAdmin resources. Follow the Rails guidelines for overriding to use this safely with Zeitwerk.
ActiveAdmin::BaseController.class_eval do
helper ApplicationHelper
endUse the controller method
This applies to one resource at a time.
ActiveAdmin.register User do
controller do
helper UserHelper
end
endCSS
To prevent ActiveAdmin styles from overriding your application styles, remove the require_tree command from the application's CSS file that includes active_admin.scss in its tree.
Deprecation warnings with modern sass build tools
Active Admin v3's SCSS is written for sassc, which follows an older version of the SCSS specification. If you use a Node-based build system like esbuild, webpacker, or vite, you may encounter deprecation warnings for color functions like this when compiling assets:
DEPRECATION WARNING: lighten() is deprecated
As a quick workaround, you may be able to silence these warnings by passing the quietDeps scss compilation option in your build system. With vite, follow these instructions: https://github.com/vitejs/vite/discussions/4013#discussioncomment-10793687 (note this requires installing the sass-embedded dependency).
Conflicts
With gems that provides a search class method on a model
If a gem defines a search class method on a model, it can conflict with the method provided by ransack, a dependency of ActiveAdmin.
Use the solution for the gem that defines the conflicting method:
tire, retire and elasticsearch-rails
Call the gem's search method explicitly:
For tire and retire
YourModel.tire.searchFor elasticsearch-rails
YourModel.__elasticsearch__.searchSunspot Solr
YourModel.solr_searchAuthentication & Application Controller
ActiveAdmin::BaseController inherits from ApplicationController. The authentication callbacks in ApplicationController run instead of the authentication method in the Active Admin configuration file. For example, if ApplicationController has a before_action :custom_authentication_method callback and the configuration sets config.authentication_method = :authenticate_active_admin_user, then custom_authentication_method runs instead of authenticate_active_admin_user.