diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-27 19:45:51 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-03-27 19:45:51 -0300 |
commit | 32763a82444ba5eb711ec0e5d6380818e5f2695d (patch) | |
tree | cdb2cbd81f67e7c1bd4bd09c9182f4c108faad3f /actionpack/lib/action_view/helpers/tags | |
parent | 6ce0a6de7e698dabcef10b8ebc855b47555d540b (diff) | |
download | rails-32763a82444ba5eb711ec0e5d6380818e5f2695d.tar.gz rails-32763a82444ba5eb711ec0e5d6380818e5f2695d.tar.bz2 rails-32763a82444ba5eb711ec0e5d6380818e5f2695d.zip |
Check if the options hash already exists and merge it with the another
hash.
Closes #2492 and #5615
Diffstat (limited to 'actionpack/lib/action_view/helpers/tags')
-rw-r--r-- | actionpack/lib/action_view/helpers/tags/label.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/tags/label.rb b/actionpack/lib/action_view/helpers/tags/label.rb index 1bd71c2778..1c8bf063ea 100644 --- a/actionpack/lib/action_view/helpers/tags/label.rb +++ b/actionpack/lib/action_view/helpers/tags/label.rb @@ -3,16 +3,16 @@ module ActionView module Tags class Label < Base #:nodoc: def initialize(object_name, method_name, template_object, content_or_options = nil, options = nil) + options ||= {} + content_is_options = content_or_options.is_a?(Hash) if content_is_options - options = content_or_options + options.merge! content_or_options @content = nil else @content = content_or_options end - options ||= {} - super(object_name, method_name, template_object, options) end |