Skip to content

Instantly share code, notes, and snippets.

@djsun
Created December 7, 2009 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djsun/250891 to your computer and use it in GitHub Desktop.
Save djsun/250891 to your computer and use it in GitHub Desktop.
module Utility
# ActiveSupport 2.3.5 adds @_rails_html_safe aggressively.
# This method removes it so you can output clean YAML.
def self.plain_string(s)
if s.instance_variable_defined?(:@_rails_html_safe)
s.send(:remove_instance_variable, :@_rails_html_safe)
end
s
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment