5

What is the opposite of html_escape function? Why isn't there an html_unescape?

http://api.rubyonrails.org/classes/ERB/Util.html#method-c-html_escape

Chloe
  • 25,162
  • 40
  • 190
  • 357

2 Answers2

2

Maybe this class method from CGI class in ruby?

delphaber
  • 199
  • 1
  • 13
  • Thanks! I found it too and was just about to post the answer! Actually, you linked to URI unescape, for `%20` characters, and I needed #unescapeHTML for `'` characters, but it's close enough! [CGI::unescapeHTML](http://ruby-doc.org/stdlib-2.1.0/libdoc/cgi/rdoc/CGI/Util.html#method-i-unescapeHTML) – Chloe Jan 11 '14 at 00:11
0

raw might be what you are looking for.

http://api.rubyonrails.org/classes/ActionView/Helpers/OutputSafetyHelper.html#method-i-raw

a-b-r-o-w-n
  • 515
  • 2
  • 17