# Outputs the corresponding flash message if any are set
def flash_messages
messages = []
%w(notice warning error).each do |msg|
messages << content_tag(:div, content_tag(:p,
html_escape(flash[msg.to_sym])), :class => "message #{msg}") unless
flash[msg.to_sym].blank?
end
messages
end
I am not sure how to make it html_safe so that Rails 3 renders it
properly. No problems with Rails 2.3.8, but I had to mark the entire
method "safe_method" using rails_xss plugin.
Is there a rule to doing this kind of view sanitization?
Thanks.
Bharat
--
Posted via http://www.ruby-forum.com/.
Rails 3 is html safe by default. You only need to use 'raw' if you
want it unsafe.
--
Greg Donald
destiney.com | gregdonald.com
What I meant to ask is how do I fix the method shown above so that the
rendered HTML is not escaped and therefore displays properly?