diff options
author | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-07-02 12:14:23 -0700 |
---|---|---|
committer | Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com> | 2009-07-02 12:14:23 -0700 |
commit | 0fbf458b6c7992a1626282727a70636af19450d5 (patch) | |
tree | 00dbf56f7561a5eab85b3d0d62b1788e701321d2 /actionpack/lib/action_view | |
parent | d03689971758b905fa0087bc93cf474a9d0585f5 (diff) | |
download | rails-0fbf458b6c7992a1626282727a70636af19450d5.tar.gz rails-0fbf458b6c7992a1626282727a70636af19450d5.tar.bz2 rails-0fbf458b6c7992a1626282727a70636af19450d5.zip |
Removed unnecessary calls to image_path and hash lookups [#2827 state:resolved]
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/asset_tag_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/asset_tag_helper.rb b/actionpack/lib/action_view/helpers/asset_tag_helper.rb index a3b99327ce..6d2c28f969 100644 --- a/actionpack/lib/action_view/helpers/asset_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/asset_tag_helper.rb @@ -505,8 +505,8 @@ module ActionView 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+$} @@ -514,7 +514,7 @@ module ActionView 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) |