Skip to content
Browse files

Removed unnecessary calls to image_path and hash lookups [#2827 state…

…:resolved]
  • Loading branch information...
1 parent d036899 commit 0fbf458b6c7992a1626282727a70636af19450d5 Yehuda Katz + Carl Lerche committed Jul 2, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_view/helpers/asset_tag_helper.rb
View
6 actionpack/lib/action_view/helpers/asset_tag_helper.rb
@@ -505,16 +505,16 @@ def video_path(source)
def image_tag(source, options = {})
options.symbolize_keys!
- options[:src] = path_to_image(source)
- options[:alt] ||= File.basename(options[:src], '.*').split('.').first.to_s.capitalize
+ src = options[:src] = path_to_image(source)
+ options[:alt] ||= File.basename(src, '.*').split('.').first.to_s.capitalize
if size = options.delete(:size)
options[:width], options[:height] = size.split("x") if size =~ %r{^\d+x\d+$}
end
if mouseover = options.delete(:mouseover)
options[:onmouseover] = "this.src='#{image_path(mouseover)}'"
- options[:onmouseout] = "this.src='#{image_path(options[:src])}'"
+ options[:onmouseout] = "this.src='#{src}'"
end
tag("img", options)

0 comments on commit 0fbf458

Please sign in to comment.
Something went wrong with that request. Please try again.