aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view
diff options
context:
space:
mode:
authorTimm <kaspth@gmail.com>2013-07-15 22:10:03 +0200
committerTimm <kaspth@gmail.com>2014-06-15 23:40:54 +0200
commitdad96eff0df2adbcef91360387bcc323bc76faea (patch)
treeadbb96ff8f21fc07bd54508dcc869290e3a63128 /actionview/lib/action_view
parent8fdf86c5f79e68a14ce4b052d6e89f09121868c6 (diff)
downloadrails-dad96eff0df2adbcef91360387bcc323bc76faea.tar.gz
rails-dad96eff0df2adbcef91360387bcc323bc76faea.tar.bz2
rails-dad96eff0df2adbcef91360387bcc323bc76faea.zip
Updated the documentation to reflect the scrubber option.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r--actionview/lib/action_view/helpers/sanitize_helper.rb23
1 files changed, 22 insertions, 1 deletions
diff --git a/actionview/lib/action_view/helpers/sanitize_helper.rb b/actionview/lib/action_view/helpers/sanitize_helper.rb
index 66894b5936..a04c7a56b5 100644
--- a/actionview/lib/action_view/helpers/sanitize_helper.rb
+++ b/actionview/lib/action_view/helpers/sanitize_helper.rb
@@ -27,7 +27,28 @@ module ActionView
#
# <%= sanitize @article.body %>
#
- # Custom Use (only the mentioned tags and attributes are allowed, nothing else)
+ # Custom Use - Custom Scrubber
+ # (supply a Loofah::Scrubber that does the sanitization)
+ #
+ # scrubber can either wrap a block:
+ # scrubber = Loofah::Scrubber.new do |node|
+ # node.text = "dawn of cats"
+ # end
+ #
+ # or be a subclass of Loofah::Scrubber which responds to scrub:
+ # class KittyApocalypse < Loofah::Scrubber
+ # def scrub(node)
+ # node.text = "dawn of cats"
+ # end
+ # end
+ # scrubber = KittyApocalypse.new
+ #
+ # <%= sanitize @article.body, scrubber: scrubber %>
+ #
+ # Learn more about scrubbers here: https://github.com/flavorjones/loofah
+ #
+ # Custom Use - tags and attributes
+ # (only the mentioned tags and attributes are allowed, nothing else)
#
# <%= sanitize @article.body, tags: %w(table tr td), attributes: %w(id class style) %>
#