I have recently upgraded an old app to Ruby on Rails 3.2.9. While enabling the asset pipeline, I changed my css.scss files to css.scss.erb so that I could use the helpers to load only the fingerprinted image files, like this:
`background: url(<%= asset_path "wishlist.png" %>)`
This works on standalone files, but when the css.scss.erb file has to be imported by screen.css.scss, it returns the following error:
`Invalid CSS after "...d: url(": expected ")", was "<%= asset_path ..."
I tried all the suggestions presented on this question, but none of them avoids the error while making the app load the fingerprinted files.
Any solutions?
Thanks in advance.
The problem was that the sass-helpers provided on the Ruby on Rails Guide to the Asset Pipeline were using an hyphen instead of an underscore. Change everything to
image_pathinstead ofimage-path(and so on) and it should work fine, like on this:background: url(image_path("wishlist.png"));