Skip to content

rs-pro/activeadmin_addons

 
 

Repository files navigation

ActiveAdmin Addons

Gem Version NPM Version CI

ActiveAdmin Addons will extend your ActiveAdmin and enable a set of addons you can optionally use to improve the ActiveAdmin UI and make it awesome.

🚀 ActiveAdmin 4 Support

This gem now supports ActiveAdmin 4! The latest beta version includes:

  • Support for modern JavaScript bundlers (esbuild, webpack, importmap)
  • ESM module support for better tree-shaking
  • Updated CSS selectors for ActiveAdmin 4 compatibility
  • NPM package available for easier JavaScript management

What you get:

Rows/Columns

Inputs

Filters

Themes

Installation

Requirements

  • Ruby >= 3.2
  • Rails >= 7.0
  • ActiveAdmin >= 3.0 (ActiveAdmin 4 supported!)

For ActiveAdmin 4

Add this line to your application's Gemfile:

gem 'activeadmin_addons', '~> 2.0.0.beta'

And then execute:

$ bundle

After that, run the generator with your preferred bundler:

# Auto-detect your bundler (recommended)
$ rails g activeadmin_addons:install

# Or specify explicitly:
$ rails g activeadmin_addons:install --bundler=esbuild
$ rails g activeadmin_addons:install --bundler=importmap
$ rails g activeadmin_addons:install --bundler=webpack
$ rails g activeadmin_addons:install --bundler=sprockets

Using NPM Package (Optional)

For better JavaScript module management, you can also install via NPM:

npm install @platanus/activeadmin_addons

Then import in your active_admin.js:

import '@platanus/activeadmin_addons';

For ActiveAdmin 3 (Legacy)

For ActiveAdmin 3.x, use version 1.x of this gem:

gem 'activeadmin_addons', '~> 1.0'

Check here to see more information about the generator.

Migrating from ActiveAdmin 3 to 4

If you're upgrading from ActiveAdmin 3 to 4, please note:

  1. Update your Gemfile: Use version 2.x of activeadmin_addons
  2. Run the installer again: The asset pipeline has changed significantly
  3. CSS Selectors: Some CSS classes have changed (e.g., .filter_form.filters-form)
  4. JavaScript modules: Consider switching to the NPM package for better module management

For detailed migration instructions, see ActiveAdmin 4 Migration Guide.

Default changes to behaviour

Installing this gem will enable the following changes by default:

  • The default date input will be :datepicker instead of :date_select
  • Select filters will show translated values when used with Rails built-in enums
  • All select boxes will use Slim Select (replacing Select2 in v2.x)

Addons

Rows/Columns

Images

Display images in the index and show views. This implementation supports Shrine.

Read more!

AASM Integration

You can show aasm values as active admin tags.

Read more!

Rails Enum Integration

You can show Rails' built in enums as active admin tags.

Read more!

Boolean Values

Modifies how boolean values are displayed.

Read more!

Toggleable Boolean Columns

Have switches to toggle values directly at the index

Read more!

Number Formatting

You can show numbers with format supported by Rails NumberHelper

Read more!

List

You can show Array or Hash values as html lists.

Read more!

Markdown

You can render text as markdown.

Read more!

Inputs

Slim Select Input

With Slim Select the select control looks nicer, it works great with large collections.

Read more!

Tag Input

Using tags input, you can add tags using slim select.

Read more!

Selected List Input

This form control allows you to handle your many to many associations.

Read more!

Search Select Input

Using search_select input, you can easily add ajax search to activeadmin.

Read more!

Nested Select Input

Using nested_select input, you can build related select inputs.

Read more!

Color Picker Input

You can pick colors using JQuery Palette Color Picker

f.input :color, as: :color_picker

Read more!

Date Time Picker Input

You can pick dates with time using the xdan's jQuery Plugin Date and Time Picker

f.input :updated_at, as: :date_time_picker

Read more!

Filters

Numeric Range Filter

To filter based on a range of values you can use numeric_range_filter like this:

filter :number, as: :numeric_range_filter

Date Time Picker Filter

To filter based on a range of datetimes you can use date_time_picker_filter like this:

filter :created_at, as: :date_time_picker_filter

Search Select Filter

You can use the ajax select input to filter values on index view like this:

filter :category, as: :search_select_filter

Read more!

Themes

NO Theme

Use default active_admin theme.

Publishing

Publishing a New Version

On a new branch:

  1. Change VERSION in lib/activeadmin_addons/version.rb. Note that beta versions should have a .beta suffix (e.g. 2.0.0.beta.5).
  2. Change "version" in package.json to the same version. Note that beta versions should have a -beta suffix (e.g. 2.0.0-beta.5).
  3. Change Unreleased title to current version in CHANGELOG.md.
  4. Run bundle install.
  5. Open a new PR with those changes.
  6. Once the PR is merged, checkout to master and pull the changes.
  7. Create tag. For example: git tag v2.0.0.beta.5.
  8. Push tag. For example: git push origin v2.0.0.beta.5.

Automated Publishing

The GitHub Actions workflow will automatically:

  • Publish the Ruby gem to RubyGems (requires RUBYGEMS_API_KEY secret)
  • Publish the NPM package to npm registry (requires NPM_TOKEN secret)

Manual Publishing

If needed, you can publish manually:

# Ruby Gem
gem build activeadmin_addons.gemspec
gem push activeadmin_addons-2.0.0.beta.5.gem

# NPM Package
npm run prepublishOnly
npm publish --access public

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

If you want to collaborate, please check the rules first.

Credits

Thank you contributors!

Platanus

activeadmin_addons is maintained by platanus.

License

ActiveAdminAddons is © 2021 Platanus, spa. It is free software and may be redistributed under the terms specified in the LICENSE file.

About

Extends ActiveAdmin to enable a set of great optional UX improving add-ons

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 77.9%
  • JavaScript 10.3%
  • SCSS 9.1%
  • HTML 2.1%
  • Other 0.6%