gregbell/active_admin — Issue #703: Only :notice and :alert flash messages should be displayed in pages
Author: cosenmarco
Created: 2011-10-29 17:29:12+00:00
State: open

This because somebody (like me) could need to use flash for other purposes than display messages.
Here a monkey patch that I made to workaround the problem:

```ruby
module ActiveAdmin
module Views
module Pages
class Base

def build_flash_messages
keys_to_print = (flash.keys & [:notice, :alert])
if keys_to_print.count > 0
div :class => 'flashes' do
keys_to_print.each do |k|
div flash[k], :class => "flash flash_#{k.to_s}"
end
end
end
end

end
end
end
end
```