Browse files

Merge pull request #89 from henrik/patch-1

FAQ: don't include all Rack::Utils just for h().
  • Loading branch information...
2 parents 6346b79 + c5b071c commit ef2124fe15dc85792b744257052a88250ca6fa0b @rkh rkh committed Dec 16, 2012
Showing with 5 additions and 4 deletions.
  1. +5 −4 faq.markdown
9 faq.markdown
@@ -245,12 +245,13 @@ And in `mailerapp.rb`:
How do I escape HTML? {#escape_html}
-Include [Rack::Utils](
-in your helpers and create an `h` alias as follows:
+Use [Rack::Utils](
+in your helpers as follows:
helpers do
- include Rack::Utils
- alias_method :h, :escape_html
+ def h(text)
+ Rack::Utils.escape_html(text)
+ end
Now you can escape HTML in your templates like this:

0 comments on commit ef2124f

Please sign in to comment.