aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/tag_helper.rb
diff options
context:
space:
mode:
authorAvnerCohen <israbirding@gmail.com>2012-10-29 13:10:53 +0200
committerAvnerCohen <israbirding@gmail.com>2012-10-29 13:10:53 +0200
commitbe4a4cd38ff2c2db0f6b69bb72fb3557bd5a6e21 (patch)
treed7b6d29f22d5ce3aeef2a293b8ea5d55f9257868 /actionpack/lib/action_view/helpers/tag_helper.rb
parent20c574ca85e380d06c2e0f148301177a9b197b2e (diff)
downloadrails-be4a4cd38ff2c2db0f6b69bb72fb3557bd5a6e21.tar.gz
rails-be4a4cd38ff2c2db0f6b69bb72fb3557bd5a6e21.tar.bz2
rails-be4a4cd38ff2c2db0f6b69bb72fb3557bd5a6e21.zip
Hash Syntax to 1.9 related changes
Diffstat (limited to 'actionpack/lib/action_view/helpers/tag_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/tag_helper.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/actionpack/lib/action_view/helpers/tag_helper.rb b/actionpack/lib/action_view/helpers/tag_helper.rb
index 3327c69d61..8c7524e795 100644
--- a/actionpack/lib/action_view/helpers/tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/tag_helper.rb
@@ -50,16 +50,16 @@ module ActionView
# tag("br", nil, true)
# # => <br>
#
- # tag("input", :type => 'text', :disabled => true)
+ # tag("input", type: 'text', disabled: true)
# # => <input type="text" disabled="disabled" />
#
- # tag("img", :src => "open & shut.png")
+ # tag("img", src: "open & shut.png")
# # => <img src="open &amp; shut.png" />
#
- # tag("img", {:src => "open &amp; shut.png"}, false, false)
+ # tag("img", {src: "open &amp; shut.png"}, false, false)
# # => <img src="open &amp; shut.png" />
#
- # tag("div", :data => {:name => 'Stephen', :city_state => %w(Chicago IL)})
+ # tag("div", data: {name: 'Stephen', city_state: %w(Chicago IL)})
# # => <div data-name="Stephen" data-city-state="[&quot;Chicago&quot;,&quot;IL&quot;]" />
def tag(name, options = nil, open = false, escape = true)
"<#{name}#{tag_options(options, escape) if options}#{open ? ">" : " />"}".html_safe
@@ -79,12 +79,12 @@ module ActionView
# ==== Examples
# content_tag(:p, "Hello world!")
# # => <p>Hello world!</p>
- # content_tag(:div, content_tag(:p, "Hello world!"), :class => "strong")
+ # content_tag(:div, content_tag(:p, "Hello world!"), class: "strong")
# # => <div class="strong"><p>Hello world!</p></div>
- # content_tag("select", options, :multiple => true)
+ # content_tag("select", options, multiple: true)
# # => <select multiple="multiple">...options...</select>
#
- # <%= content_tag :div, :class => "strong" do -%>
+ # <%= content_tag :div, class: "strong" do -%>
# Hello world!
# <% end -%>
# # => <div class="strong">Hello world!</div>