0
0

More than 3 years have passed since last update.

本番環境でassets/imagesの配下の画像を表示させたい

Posted at

ローカル環境では
app/assets/imagesの配下の画像を表示させることができているが、本番環境になると、画像をうまく読み込まない。
これは、ローカルと本番環境では、パスが違うかららしい。

ローカルは以下のコードで画像を表示させることができる。

<%= image_tag hoge.png", class:"hoge" %>

本番環境では、asset_pathを使う必要がある。

<%= image_tag asset_path("/images/hoge.png", class:"hoge") %>
0
0
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
0
0