Module: MongodbLogger::AssetHelpers
- Defined in:
- lib/mongodb_logger/server/helpers/sprokets.rb
Instance Method Summary collapse
Instance Method Details
#asset_data_uri(source) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/mongodb_logger/server/helpers/sprokets.rb', line 11 def asset_data_uri(source) unless Assets.instance.find_asset(source).nil? asset = Assets.instance.find_asset(source) base64 = Base64.encode64(asset.to_s).gsub(/\s+/, "") "data:#{asset.content_type};base64,#{Rack::Utils.escape(base64)}" end end |