you are here: codestackercodes [RSS] → tag rails3 [RSS]

flash_messages helper method to rails 3

def flash_messages 
  %w(notice warning error).each do |msg| 
    concat content_tag(:div, content_tag(:p, flash[msg.to_sym]), :class => msg) unless flash[msg.to_sym].blank? 
  end 
end
Displaying 1 Code