You can, but the logic in here would mess up a view, thats what helpers are for.

On 25 Mar 2014, at 16:40, hrishimittal <notifications@github.com> wrote:

> In app/helpers/flash_helper.rb:
> 
> > +  ALERT_TYPES = [:danger, :info, :success, :warning]
> > +
> > +  def moj_flash
> > +    flash_messages = []
> > +    flash.each do |type, message|
> > +      # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
> > +      next if message.blank?
> > +
> > +      type = :success if type == :notice
> > +      type = :danger   if type == :alert
> > +      next unless ALERT_TYPES.include?(type)
> > +
> > +      Array(message).each do |msg|
> > +        text = content_tag(:div,
> > +                           content_tag(:button, raw("&times;"), class: 'close', data: { dismiss: "alert"} ) +
> > +                           msg.html_safe, class: "alert fade in alert-#{type}")
> That's a strange class name. Is it possible to move this to the view and avoid using html_safe?
> 
> —
> Reply to this email directly or view it on GitHub.
>