Module: ERB::Util
- Defined in:
- lib/erubis/helpers/rails_helper.rb
Overview
make h() method faster
Constant Summary collapse
- ESCAPE_TABLE =
:nodoc:
{ '&'=>'&', '<'=>'<', '>'=>'>', '"'=>'"', "'"=>''', }
Class Method Summary collapse
Class Method Details
.h(value) ⇒ Object
192 193 194 |
# File 'lib/erubis/helpers/rails_helper.rb', line 192 def h(value) value.to_s.gsub(/[&<>"]/) { |s| ESCAPE_TABLE[s] } end |