Created
March 27, 2012 11:44
-
-
Save thehenster/2215231 to your computer and use it in GitHub Desktop.
How to remove/disable the automatic XSS protection helper html escaping for Rails 3
This file contains hidden or 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
# dirty way to completely remove the automatic escaping of html in rails helpers | |
# useful to get your Rails 2 -> 3 upgrade running to the point where the raw/.html_safe additions can be delegated | |
module CustomHtmlSafe | |
def html_safe? | |
true | |
end | |
end | |
class ActionView::OutputBuffer | |
include CustomHtmlSafe | |
end | |
class ActionView::SafeBuffer | |
include CustomHtmlSafe | |
end | |
class String | |
include CustomHtmlSafe | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you put this in a initializer?