Implement a custom decorator - activeadmin/activeadmin GitHub Wiki

The ActiveAdmin's decoration itegration has dependencies on Draper gem.

If you want to use another decorator, the #decorate method should be implemented there. And it should be able to accept colletions as an argument. Here's an example for the SimpleDelegator class:

class SimpleDelegator
  class << self
    def decorate(*args)
      object = args[0]
      if is_collection?(object)
        object.map { |o| new(o) }
      else
        new(object) 
      end
    end

    def is_collection?(object)
      object.is_a?(Enumerable)
    end
  end
end