7

In my Rails 3.1 app, I have images stored under app/assets/images/jquery_ui/.

I don't know how to access these in my CSS. /assets/image_name.png and /assets/jquery_ui/image_name.png do not work.

LanguagesNamedAfterCofee
  • 5,782
  • 7
  • 45
  • 72

2 Answers2

9

Seems like /assets/jquery_ui/image_name.png should work,

See the answers here.

Community
  • 1
  • 1
ipd
  • 5,674
  • 3
  • 34
  • 49
  • No, I mentioned in the original question that it doesn't work. I don't see why not though... – LanguagesNamedAfterCofee Jul 14 '11 at 23:20
  • Is it just css that can't find them? Can you get them in a regular http request on your server? i.e. http://localhost:8888/assets/jquery_ui/image_name.png (or whatever)? – ipd Jul 15 '11 at 04:49
  • 1
    It turned out that the image not being displayed had nothing to do with the path `(/assets/jquery_ui/image.png)` was right. It was just a stupid mistake where I named the image wrong. – LanguagesNamedAfterCofee Jul 15 '11 at 05:06
  • Did not worked for me, but `/assets/images/jquery_ui/image_name.png` worked instead (Rails 3.2.8) – Dfr Nov 07 '12 at 07:18
0

If you just added some images to assets and it still doesn't work... you will need to restart your server (/WEBrick).

valk
  • 9,363
  • 12
  • 59
  • 79