我正在使用 Active Storage。我在帖子/显示视图中有以下行:
<%= video_tag(@post.video) %>
但是,当我尝试访问显示视图时,出现此错误:
Sprockets::Rails::Helper::AssetNotFound in Posts#show
The asset "" is not present in the asset pipeline.
image_tag 虽然有效。我没有以下问题:
<% @posts.each do |p| %>
<%= link_to image_tag(p.thumbnail, alt: "#{p.title}"), p %>
<% end %>
我的帖子模型有:
has_one_attached :thumbnail
has_one_attached :video
此外,当我检查我的本地数据库时,blob 和附件表正在正确保存视频文件。
所以我不确定为什么会抛出这个错误。