Changeset 2032
- Timestamp:
- 08/18/05 00:52:50 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/p2/actionpack/lib/action_view/helpers/tag_helper.rb
r2025 r2032 27 27 def tag_options(options) 28 28 if options.is_a?(Hash) 29 options = options.stringify_keys 30 sorted_option_keys = options.reject { |key, value| value.nil? }.keys.sort 31 sorted_option_keys.inject("") { |str, key| 32 str << " #{key}=\"#{html_escape(options[key])}\"" 29 cleaned_options = options.reject { |key, value| value.nil? }.stringify_keys 30 cleaned_options.keys.sort.inject("") { |html_str, key| 31 html_str << %( #{key}="#{html_escape(cleaned_options[key])}") 33 32 } 34 33 elsif options … … 39 38 def tag_options(options) 40 39 if options.is_a?(Hash) 41 options.inject("") { |str, (key, value)| 42 str << " #{key}=\"#{html_escape(value)}\"" unless value.nil? 40 html_str = "" 41 options.each { |key, value| 42 html_str << %( #{key}="#{html_escape(value)}") unless value.nil? 43 43 } 44 html_str 44 45 elsif options 45 46 " " + options