2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

sprockets::rails::helper::assetnotfound エラーの原因

Posted at

完全にメモベースですが、念のため記録。

【原因】
追記してあった”the asset "no_image.jpg" is not present in the asset pipeline.”の表記の通り、no_image.jpgがフォルダーに追加されてなかったため。

フォルダーに追加後、無事解決。

以下その際に記述した周辺コード。

<%= form_for(@user) do |f| %>
<%= f.text_field :username, autofocus: true, placeholder:"名前"%>
<%= attachment_image_tag @user, :profile_image, :fill, 60, 60, fallback: "no_image.jpg"%>
ProfileImage
<%= f.attachment_field :profile_image, placeholder: "プロフィール画像" %>
<%= f.submit "保存" %>
<% end %>

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?