ERB::Util (Module)

In: libraries/erb.rb

Methods

h   html_escape   u   url_encode  

Public Instance methods

h(s)

Alias for html_escape

[Source]

     # File libraries/erb.rb, line 463
463:     def html_escape(s)
464:       s.to_s.gsub(/&/, "&amp;").gsub(/\"/, "&quot;").gsub(/>/, "&gt;").gsub(/</, "&lt;")
465:     end
u(s)

Alias for url_encode

[Source]

     # File libraries/erb.rb, line 468
468:     def url_encode(s)
469:       s.to_s.gsub(/[^a-zA-Z0-9_\-.]/n){ sprintf("%%%02X", $&.unpack("C")[0]) }
470:     end

[Validate]