作者ofpurity (love twiggy)
看板Web_Design
标题[问题] Ruby on Rail图片路径
时间Thu Jun 5 13:32:49 2014
图片位置:
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>
我这样写是错的@@
感谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 220.130.182.55
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/Web_Design/M.1401946372.A.F56.html
1F:→ danny8376:路径要用function去生... 06/05 16:07
2F:推 alog:用helper 06/05 17:00
3F:推 qazwsx9006:url(/assets/i80/logoEis.png) 这样或许可以... 06/05 23:27
4F:→ danny8376:不可能 ror的assets後方会加上一段hash 06/05 23:48
5F:→ danny8376:用helper生路径是唯一解(除非你要改assets的预设行为) 06/05 23:49
6F:推 ducksteven:请用 image-url() (SCSS) 06/06 01:20
8F:→ qazwsx9006:受教了!!因为我都直接用/assets/pic.jpg 然後都正常跑 06/06 23:59
9F:→ qazwsx9006:出图片 06/06 23:59