-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Figure out how to support something like asset-pipeline-aware {{imageURL}}
#114
Comments
Not sure I follow... you mean something to convert src="{{imageURL hello.jpg}}" to src="/assets/hello-98werfegerg.jpg" ? |
I've got a very naive implementation of this I've been working on. |
What problem does this solve? Why wouldn't the image urls be available as part of a model or some other dynamic data? |
Site images, I've extracted as much as I can to CSS background images, but there's only so far you can go. |
Is there any recommendation for this issue? I first ran into this when attempting to add I can place the logo image in |
I'm currently loading it via an ENV variable, stripped down example below:
def preload_env
env = {}
env["ASSETS"] = asset_hash
...
env
end
def asset_hash
{
wysihtml5: javascript_path("wysihtml5-0.3.0"),
blank_avatar: image_path("avatars/avatar-blank.png"),
vendor_avatar: image_path("avatar-vendor-big.png"),
user_avatar: image_path("avatar-user-big.png"),
company_avatar: image_path("avatar-company-big.png"),
product_placeholder: image_path("product-placeholder.png")
}
end
<%= javascript_tag("window.ENV = #{preload_env.to_json.html_safe}") %>
<img src="{{unbound Ember.ENV.ASSETS.blank_avatar}}"/> |
I appreciate your help on this @bradleypriest. Very nice solution; tried it out and it worked perfectly! |
This is an interesting approach but why is it necessary? We're in Rails, just append .erb to the end of your handlebars template name and use the asset_path helper. Unless I'm missing something :)
|
👍 to @supairish Don't know why something so obvious was stumping me. Thanks for the tip! |
@supairish solution is simple and pragmatic, but for various reasons it wouldn't work for us. So, if you really need an |
No description provided.
The text was updated successfully, but these errors were encountered: