0

I'm hoping this is super simple, cause it's very basic. using the assets pipline got a css in sub sub folder, exampla

vendor->stylsheets->foo->bar->style.css

in this style.css I got the following

background-image:url("../../Template/img/k.png")

this works when assets and resources are not compiled (development)

but not on production.. on production the ../ needs to be removed.

how do I make it work in any situation?

Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
  • @jibiel is right: for this to work with the asset pipeline it all needs to move under `app/assets`. If you want to keep vendor assets separate, put them all under `app/assets/vendor` and then in `application.rb` add the path to the search paths: `config.assets.paths << Rails.root.join("app", "assets", "vendor")` – Ross Allen Dec 26 '12 at 18:38

2 Answers2

1

Eventually I moved the css file to the root folder of my assets/styleshit, and it worked.

Chen Kinnrot
  • 20,609
  • 17
  • 79
  • 141
0

Try to move your image to app/assets/images directory and replace your line with following:

background-image: image-url('k.png')

Or if you'd like to keep your folder hierachy, assuming your image is in the app/assets/images/Template/img/:

background-image: image-url('Template/img/k.png')

More about -url and -path helpers that sass-rails provides.

jibiel
  • 8,175
  • 7
  • 51
  • 74