mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Removed unnecessary calls to image_path and hash lookups [#2827 state:resolved]
This commit is contained in:
parent
d036899717
commit
0fbf458b6c
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue