diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:53:23 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-01-06 20:53:23 +0000 |
commit | a1b0349362fd6c17af5aeff481996f6fac235828 (patch) | |
tree | acae9550ddae5e678618b9eb79ffc3bbf00b5c23 /actionpack/lib/action_view/template_handlers | |
parent | ca4c7ab362d0110bfade496ca66b30bafdb7f25e (diff) | |
download | rails-a1b0349362fd6c17af5aeff481996f6fac235828.tar.gz rails-a1b0349362fd6c17af5aeff481996f6fac235828.tar.bz2 rails-a1b0349362fd6c17af5aeff481996f6fac235828.zip |
The asset_host block takes the controller request as an optional second argument. Example: use a single asset host for SSL requests. Closes #10549.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8578 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/template_handlers')
-rw-r--r-- | actionpack/lib/action_view/template_handlers/erb.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/template_handlers/erb.rb b/actionpack/lib/action_view/template_handlers/erb.rb index 022fc362e7..87cb09952c 100644 --- a/actionpack/lib/action_view/template_handlers/erb.rb +++ b/actionpack/lib/action_view/template_handlers/erb.rb @@ -4,6 +4,15 @@ class ERB module Util HTML_ESCAPE = { '&' => '&', '"' => '"', '>' => '>', '<' => '<' } + # A utility method for escaping HTML tag characters. + # This method is also aliased as <tt>h</tt>. + # + # In your ERb templates, use this method to escape any unsafe content. For example: + # <%=h @person.name %> + # + # ==== Example: + # puts html_escape("is a > 0 & a < 10?") + # # => is a > 0 & a < 10? def html_escape(s) s.to_s.gsub(/[&"><]/) { |special| HTML_ESCAPE[special] } end |