1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Prefer inspect over escaping and sorround by quote marks

This commit is contained in:
Santiago Pastorino 2016-01-05 18:32:16 -03:00
parent 8a998b0fa7
commit b7b508aa79

View file

@ -2,9 +2,7 @@ module ActionView
module Template::Handlers
class Raw
def call(template)
escaped = template.source.gsub(':'.freeze, '\:'.freeze)
'%q:' + escaped + ':;'
"#{template.source.inspect};"
end
end
end