We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d9e95c commit 5392ddaCopy full SHA for 5392dda
app/helpers/application_helper.rb
@@ -60,8 +60,15 @@ def lazy_image_tag(source, options={})
60
options[:class] = "lazyload" :
61
options[:class] = "lazyload #{options[:class]}"
62
63
- options[:min].blank? ?
64
- image_tag(asset_path('/spinner.svg'), options) :
65
- image_tag(asset_path(options[:min]), options)
+ if options[:min] == true
+ # Use minified image path: foo.png -> foo.min.png
+ image_tag(asset_path(source).split('.').join('.min.'), options)
66
+ elsif !options[:min].blank?
67
+ # The minified path above can be overridden if path is given.
68
+ image_tag(asset_path(options[:min]), options)
69
+ else
70
+ # Default minified image is spinner.
71
+ image_tag(asset_path('/spinner.svg'), options)
72
+ end
73
end
74
0 commit comments