The question came up today: what is the difference between Rails’ html_safe() and raw(). There is an excellent post by Yehuda Katz on this. It really boils down to this:
def raw(stringish) stringish.to_s.html_safe end
Yes. raw() is a wrapper around html_safe() that forces the input to String and then calls html_safe() on it. It’s also the case that raw() is a helper in a module whereas html_safe() is a method on the String class which makes a new ActiveSupport::SafeBuffer instance—that has a @dirty flag in it.