Reputation: 86
I have a rails 3.1 app deployed in a subdirectory (/customers) on Apache+Passenger, using this method http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri
In /app/assets/stylesheets/app.css.erb this code
background: url(<%=image_path("top.jpg")%>)
generates
background: url(/assets/top.jpg)
instead of /customers/assets/top.jpg
In my views,
image_path("top.jpg")
will generate
/customers/assets/top.jpg
like I expect.
Any ideas?
Upvotes: 1
Views: 326
Reputation: 2209
background: image-url("top.jpg")
should work after renaming to .css.scss
Upvotes: 0
Reputation: 10493
You should use asset_path inside your CSS instead of image_path.
Upvotes: 1