From 589d1ed722a3add255adc5636eab7dcc262dd0ca Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Wed, 5 Mar 2014 11:38:39 -0800 Subject: Update doc for TagHelper. --- actionview/lib/action_view/helpers/tag_helper.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/tag_helper.rb b/actionview/lib/action_view/helpers/tag_helper.rb index 3528381781..a9f3b0ffbc 100644 --- a/actionview/lib/action_view/helpers/tag_helper.rb +++ b/actionview/lib/action_view/helpers/tag_helper.rb @@ -42,7 +42,8 @@ module ActionView # For example, a key +user_id+ would render as data-user-id and # thus accessed as dataset.userId. # - # 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 .data() # from 1.4.3. # @@ -56,6 +57,9 @@ module ActionView # tag("input", type: 'text', disabled: true) # # => # + # tag("input", type: 'text', class: ["strong", "highlight"]) + # # => + # # tag("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 (disabled and + # The +options+ hash can be used with attributes with no value like (disabled and # readonly), 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 # # =>

Hello world!

# content_tag(:div, content_tag(:p, "Hello world!"), class: "strong") # # =>

Hello world!

+ # content_tag(:div, "Hello world!", class: ["strong", "highlight"]) + # # =>
Hello world!
# content_tag("select", options, multiple: true) # # => # -- cgit v1.2.3