1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added RDoc info for accepted options for simple_format in TextHelper.

This commit is contained in:
Steve Schwartz 2011-02-10 17:28:53 -05:00
parent 35a266edfd
commit f4ddb4da89

View file

@ -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)