aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorSteve Schwartz <steve@alfajango.com>2011-02-10 17:28:53 -0500
committerSteve Schwartz <steve@alfajango.com>2011-02-15 12:58:57 -0500
commitf4ddb4da89906e2339eefcb835e2af4673218b30 (patch)
treea0c31fd7d3aff598635a404fbf2548763c20ca59 /actionpack/lib/action_view
parent35a266edfd9ac0f3afe7f7f13c2dcf29cb4b651f (diff)
downloadrails-f4ddb4da89906e2339eefcb835e2af4673218b30.tar.gz
rails-f4ddb4da89906e2339eefcb835e2af4673218b30.tar.bz2
rails-f4ddb4da89906e2339eefcb835e2af4673218b30.zip
Added RDoc info for accepted options for simple_format in TextHelper.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/text_helper.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/text_helper.rb b/actionpack/lib/action_view/helpers/text_helper.rb
index 4f7f5c454f..2d3c5fe7e7 100644
--- a/actionpack/lib/action_view/helpers/text_helper.rb
+++ b/actionpack/lib/action_view/helpers/text_helper.rb
@@ -234,6 +234,10 @@ module ActionView
#
# You can pass any HTML attributes into <tt>html_options</tt>. These
# will be added to all created paragraphs.
+ #
+ # ==== Options
+ # * <tt>:sanitize</tt> - If +false+, does not sanitize +text+.
+ #
# ==== Examples
# my_text = "Here is some basic text...\n...with a line break."
#
@@ -247,6 +251,9 @@ module ActionView
#
# simple_format("Look ma! A class!", :class => 'description')
# # => "<p class='description'>Look ma! A class!</p>"
+ #
+ # simple_format("<span>I'm allowed!</span> It's true.", {}, :sanitize => false)
+ # # => "<p><span>I'm allowed!</span> It's true.</p>"
def simple_format(text, html_options={}, options={})
text = ''.html_safe if text.nil?
start_tag = tag('p', html_options, true)