Now that Rails 3 escapes all evaluated elements in views (good), but it is also escaping my flash message. And I like the occasional link in my flash message (or strong or emphasis).
A flash message:
flash[:notice] = "<strong>Bob</strong> was sucessfully checked in.<br />If you made a mistake, you can <a href=\"/scouts/#{@scout.id}/check_out\">check out Bob</a> to undo."
Becomes garbled, escaped, unusable.
I can unescape the message using raw
:
- flash.each do |name, msg|
= content_tag :div, raw(msg)
But now every flash message is unescaped.
How can I unescape just a singe flash message? or just parts of the message?