Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sinatra/sinatra.github.com
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed May 17, 2011
2 parents 4823696 + 5e532a8 commit d53a9ee
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions faq.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,22 @@ Now you can escape html in your templates like this:
Thanks to [Chris Schneider](http://www.gittr.com/index.php/archive/using-rackutils-in-sinatra-escape_html-h-in-rails/)
for the tip!

How do I automatically escape html? {#auto_escape_html}
---------------------

Require [Erubis](http://rubygems.org/gems/erubis) and set `escape_html` to `true`:

require 'erubis'
set :erubis, :escape_html => true

Then, any templates rendered with Erubis will be automatically escaped:

get '/' do
erubis :index
end

Read more on the [Tilt Google Group](https://groups.google.com/forum/#!topic/tiltrb/PPm-sMz6Swc) and see [this example app](http://flowcoder.com/177) for details.

How do I use ActiveRecord migrations? {#ar-migrations}
-------------------------------------

Expand Down

0 comments on commit d53a9ee

Please sign in to comment.