Module: ERB::Util

Defined in:
lib/erubis/helpers/rails_helper.rb

Overview

make h() method faster (only for Rails 1.X)

Constant Summary collapse

ESCAPE_TABLE =

:nodoc:

{ '&'=>'&amp;', '<'=>'&lt;', '>'=>'&gt;', '"'=>'&quot;', "'"=>'&#039;', }

Class Method Summary collapse

Class Method Details

.h(value) ⇒ Object



342
343
344
# File 'lib/erubis/helpers/rails_helper.rb', line 342

def h(value)
  value.to_s.gsub(/[&<>"]/) {|s| ESCAPE_TABLE[s] }
end