Rails 3.1使用app / assets / images /子目录下的图像

时间:2022-11-10 20:37:16

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

在我的Rails 3.1应用程序中,我将图像存储在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.

我不知道如何在我的CSS中访问这些。 /assets/image_name.png和/assets/jquery_ui/image_name.png不起作用。

2 个解决方案

#1


9  

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

似乎/assets/jquery_ui/image_name.png应该工作,

See the answers here.

请在此处查看答案。

#2


0  

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

如果您刚刚将一些图像添加到资源但它仍然无效......您将需要重新启动服务器(/ WEBrick)。

#1


9  

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

似乎/assets/jquery_ui/image_name.png应该工作,

See the answers here.

请在此处查看答案。

#2


0  

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

如果您刚刚将一些图像添加到资源但它仍然无效......您将需要重新启动服务器(/ WEBrick)。