开发者

How do I access the images in rails 3.1?

In my sample project for the previous rails versions I would access the images as

<%= image_tag(product.image_url, :class => 'list_image') %>

How can I do the same in rails 3.1 sinc开发者_StackOverflow中文版e the images folder has been moved to app/assets/ ?


Links like this:

<img src="/images/my-image.jpg" />

become:

<img src="/assets/my-image.jpg" />

Rails does some magic to figure out that it's actually in the images directory. So no need to specify the images directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜