【发布时间】:2018-02-19 21:05:29
【问题描述】:
我确信有很多这样的帖子,但是在检查它们之后,我没有找到任何人来回答我的问题。
我正在尝试使用link_to 获取位于"app/assets/images/levers/I.a.1.png" 的图像,如下所示:
<%= link_to("Biomasa", image_path("levers/I.a.1.png"), :target => "_new") %>
无论我尝试了多少次不同的路径组合,它都不起作用。我收到此错误:
The asset "levers/I.a.1.png" is not present in the asset pipeline.
我有什么遗漏或做错了吗?
更多信息
我不确定是否重要,但我使用“Windows 上的 Ubuntu 上的 Bash”来使我的 Windows 10 上的一切成为可能(在工作中很明显)。
【问题讨论】:
-
图片名称是什么?是
image.png还是I.a.1.png? -
是“I.a.1.png”,对不起我最后的解释,我编辑了它以使其更清楚。
-
尝试
asset_path而不是image_path -
@Pavan,与
asset_path我得到相同的结果。
标签: ruby-on-rails image hyperlink reference assets