RailsAdminAAFTheme

Installation

Add this line to your application's Gemfile (after gem 'rails_admin'):

gem 'rails_admin_aaf_theme'

And then execute:

$ bundle

RailsAdmin initializer

In your RailsAdmin initializer, adding the following is suggested.

AAF::SecureHeaders.development_mode! if Rails.env.development?

SecureHeaders::Configuration.override(:rails_admin) do |config|
  config.csp[:style_src] << "'unsafe-inline'"
  config.csp[:connect_src] = ["'self'"]
  config.csp[:script_src] = config.csp[:script_src] + [
    "'unsafe-eval'",
    "'sha256-2IZ3eH4vQ4iO/yUXEJx3CWqGvsT1mFTk9j1WeznailE='"
    # <script>
    #   jQuery(function($) {
    #
    #   });
    # </script>
  ]
end

Kaminari.configure do |config|
  config.page_method_name = :per_page_kaminari
end

Theme usage by RailsAdmin

In your config/application.rb add:

ENV['RAILS_ADMIN_THEME'] = 'aaf_theme'

Conflicts

RailsAdmin can have a conflict with Lipstick's FormHelper.

If you are not using Lipstick form helpers, it's suggested to remove the following from your application_helper.rb:

  include Lipstick::Helpers::FormHelper