Open guiocavalcanti opened 13 years ago
Anyone?
The quick and short answer is that you need to prepend the items in your tags var with
ActionController::Base.asset_host.call(source, request)
It is a hack because you assume the asset_host is a Proc (probably true if you are using jammit-s3 and have not manually set asset_host in your environment configs).
The proper answer is to use one of ActiveView helpers, but which one depends on the version of rails you are using. Take a look at your actionpack/lib/action_view/helpers/asset_tag_helper.rb and search for asset_host.
Hello,
I'm doing a lazy loading feature (loading some assets via JavaScript) and I can't realize how to get the asset S3 URL. I tried
Jammit.asset_url(:lazy_asset, :js)
but it gave me something like/assets/lazy_asset.js
, which is not what I expected.I'm doing this job on the following helper:
And the result is:
Which I expected to be: