Skip to content

Commit

Permalink
Added RDoc info for accepted options for simple_format in TextHelper.
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed Feb 15, 2011
1 parent 35a266e commit f4ddb4d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions actionpack/lib/action_view/helpers/text_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ def word_wrap(text, *args)
#
# 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."
#
Expand All @@ -247,6 +251,9 @@ def word_wrap(text, *args)
#
# 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)
Expand Down

0 comments on commit f4ddb4d

Please sign in to comment.