mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update doc for TagHelper.
This commit is contained in:
parent
cee7a06746
commit
589d1ed722
1 changed files with 8 additions and 2 deletions
|
@ -42,7 +42,8 @@ module ActionView
|
|||
# For example, a key +user_id+ would render as <tt>data-user-id</tt> and
|
||||
# thus accessed as <tt>dataset.userId</tt>.
|
||||
#
|
||||
# Values are encoded to JSON, with the exception of strings and symbols.
|
||||
# Values are encoded to JSON, with the exception of strings, symbols and
|
||||
# BigDecimals.
|
||||
# This may come in handy when using jQuery's HTML5-aware <tt>.data()</tt>
|
||||
# from 1.4.3.
|
||||
#
|
||||
|
@ -56,6 +57,9 @@ module ActionView
|
|||
# tag("input", type: 'text', disabled: true)
|
||||
# # => <input type="text" disabled="disabled" />
|
||||
#
|
||||
# tag("input", type: 'text', class: ["strong", "highlight"])
|
||||
# # => <input class="strong highlight" type="text" />
|
||||
#
|
||||
# tag("img", src: "open & shut.png")
|
||||
# # => <img src="open & shut.png" />
|
||||
#
|
||||
|
@ -75,7 +79,7 @@ module ActionView
|
|||
# Set escape to false to disable attribute value escaping.
|
||||
#
|
||||
# ==== Options
|
||||
# The +options+ hash is used with attributes with no value like (<tt>disabled</tt> and
|
||||
# The +options+ hash can be used with attributes with no value like (<tt>disabled</tt> and
|
||||
# <tt>readonly</tt>), which you can give a value of true in the +options+ hash. You can use
|
||||
# symbols or strings for the attribute names.
|
||||
#
|
||||
|
@ -84,6 +88,8 @@ module ActionView
|
|||
# # => <p>Hello world!</p>
|
||||
# content_tag(:div, content_tag(:p, "Hello world!"), class: "strong")
|
||||
# # => <div class="strong"><p>Hello world!</p></div>
|
||||
# content_tag(:div, "Hello world!", class: ["strong", "highlight"])
|
||||
# # => <div class="strong highlight">Hello world!</div>
|
||||
# content_tag("select", options, multiple: true)
|
||||
# # => <select multiple="multiple">...options...</select>
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue