-
-
Save bernd/2d5563f51586156dcc81 to your computer and use it in GitHub Desktop.
Monkey patch ERB::Util#html_escape in rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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