[问题] Ruby on Rail图片路径

楼主: ofpurity (love twiggy)   2014-06-05 13:32:49
图片位置:
app/assets/images/i80/logoEis.png
网页位置:
app/view/statistics/i80/applycase/index.html
我想在index放背景图片 路景怎么放??
<div style="background-image:url(/assets/images/i80/logoEis.png);"></div>
我这样写是错的@@
感谢
作者: danny8376 (钓到一只猴子@_@)   2014-06-05 16:07:00
路径要用function去生...
作者: alog (A肉哥)   2014-06-05 17:00:00
用helper
作者: qazwsx9006 (松鼠!碰器!)   2014-06-05 23:27:00
url(/assets/i80/logoEis.png) 这样或许可以...
作者: danny8376 (钓到一只猴子@_@)   2014-06-05 23:48:00
不可能 ror的assets后方会加上一段hash用helper生路径是唯一解(除非你要改assets的默认行为)
作者: ducksteven (鸭七‧林新)   2014-06-06 01:20:00
请用 image-url() (SCSS)
作者: banjmin (HD)   2014-06-06 17:43:00
小心这篇的议题 http://wp.xdite.net/?p=3128
作者: qazwsx9006 (松鼠!碰器!)   2014-06-06 23:59:00
受教了!!因为我都直接用/assets/pic.jpg 然后都正常跑出图片

Links booklink

Contact Us: admin [ a t ] ucptt.com