module ActiveAdmin::ViewHelpers::FlashHelper

def flash_messages

Note Rails >= 4.1 normalizes keys to strings automatically.
This method removes the :timedout key that Devise uses by default.
Returns all the flash keys to display in any Active Admin view.
def flash_messages
  @flash_messages ||= flash.to_hash.with_indifferent_access.except(*active_admin_application.flash_keys_to_except)
end