【发布时间】:2015-10-22 07:48:54
【问题描述】:
我的代码是
<%= link_to image_tag("user.png", class: "profile-img"), "/images/user.png", class: "colorbox" %>
如果我给了
<%= link_to image_tag(current_user.avatar.url(:thumb), class: "profile-img"),current_user.avatar.url, class: "colorbox" %>
它工作正常,但在以前的情况下它找不到 user.png。
我想给一个静态图片的链接href
【问题讨论】:
-
图片在你的文件结构中的什么位置?
-
assets/images/user.png 中的图片
-
您使用的是回形针,对吗?问题:如果包含回形针,为什么要使用静态链接?
标签: ruby-on-rails ruby ruby-on-rails-4 asset-pipeline