lib/sinatra/assetpack/helpers.rb in sinatra-assetpack-0.2.8 vs lib/sinatra/assetpack/helpers.rb in sinatra-assetpack-0.3.0
- old
+ new
@@ -8,22 +8,11 @@
def js(*args)
show_asset_pack :js, *args
end
def img(src, options={})
- attrs = { :src => src }.merge(options)
-
- local = settings.assets.local_file_for src
- if local
- i = Image[local]
-
- attrs[:src] = HtmlHelpers.get_file_uri(src, settings.assets)
-
- if i.dimensions?
- attrs[:width] ||= i.width
- attrs[:height] ||= i.height
- end
- end
+ attrs = { :src => HtmlHelpers.get_file_uri(src, settings.assets) }
+ .merge!(options)
"<img#{HtmlHelpers.kv attrs} />"
end
def show_asset_pack(type, *args)