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



313
314
315
# File 'lib/erubis/helpers/rails_helper.rb', line 313

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