Skip to content

Instantly share code, notes, and snippets.

@bernd
Created September 5, 2012 13:55
Show Gist options
  • Save bernd/2d5563f51586156dcc81 to your computer and use it in GitHub Desktop.
Save bernd/2d5563f51586156dcc81 to your computer and use it in GitHub Desktop.
Monkey patch ERB::Util#html_escape in rails
class ERB
module Util
def html_escape(*args)
puts "FFFFFF"
end
alias h html_escape
singleton_class.send(:remove_method, :html_escape)
module_function :html_escape, :h
end
end
puts "LOADING"
puts ERB::Util.html_escape("call html_escape")
puts ERB::Util.h("call h")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment