I am using ember with rails. I want to get image path in rails asset pipeline. Does emberjs has any function like asset-path in sass-rails?
The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass, and ERB.
To compile your assets locally, run the assets:precompile task locally on your app. Make sure to use the production environment so that the production version of your assets are generated. A public/assets directory will be created. Inside this directory you'll find a manifest.
This is hardly ideal, but for lack of a better solution I've been handling this in my css:
.logo{
background-image: url(image_path('logo.png'))
}
This approach is often fine, but it has drawbacks. There's an excellent Stackoverflow discussion of using img tags vs background-image here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With