I am using paperclip to upload user avatar. Here is User model:
has_attached_file :avatar, :styles => { :medium => "300x300>", :thumb => "100x100>" }, :default_url => "user.png", :path => "app/assets/images/:class/:attachment/:id/:basename_:style.:extension", :url => ":class/:attachment/:id/:basename_:style.:extension"
So image is saving in app/assets/images/user/avatar/:id/:basename_:style.:extension
But when I do
<%= image_tag @user.avatar.url %>
It shown as:
<img src="/images/users/avatars/15/99e88dc27c19d8c6163d9cd305f738be_original.jpg" alt="99e88dc27c19d8c6163d9cd305f738be original">
i.e. inserts "/images" instead of "/assets"
I double-checked, the avatar image exists in the assets/images/user/avatar/ folder
Although all other images in page are showing correctly using assets pipeline "/assets/logo-thebighashgohere.png"
NOTE: This works correctly if I manually insert image url as string i.e.:
<%= image_tag "users/avatars/15/99e88dc27c19d8c6163d9cd305f738be_original.jpg" %>
It correctly shows as
<img src="/assets/users/avatars/15/99e88dc27c19d8c6163d9cd305f738be_original-thebighashgohere.jpg" alt="99e88dc27c19d8c6163d9cd305f738be original thebighashgohere">