我想要一张我的产品图片链接到产品展示页面。我试过:
<%= link_to product.photos.first.image.url(:small), product%>产
<a href="/products/64">/system/photos/images/000/000/023/small/4462867927_3741423c39_o.jpg?1395899030</a>我也试过
<a href="<%= products_path(product) %>"> <%= image_tag product.photos.first.image.url(:small) %> </a>它产生:
<a href="/products.64"> <img alt="4462867927 3741423c39 o" src="/system/photos/images/000/000/023/small/4462867927_3741423c39_o.jpg?1395899030"> </a>这也不对。在Rails中做这件事的最好方法是什么?
发布于 2014-03-28 03:45:33
<%= link_to image_tag(product.photos.first.image.url(:small)), product %>
https://stackoverflow.com/questions/22703647
复制相似问题