** Day 20 of Calendar Planning 2020 ** It's been about 3 months since I started studying programming, so I will leave a note of what I learned in the article as an output. I would be happy if I could help anyone entering the world of programming. Please let me know if there are any words that are wrong, wrong, or misunderstood ^^ I'm sorry if it's hard to read the words for a long time. I will do my best to get used to it little by little.
This is a note of what happened when I was actually creating the web application.
When I first created it, the image was displayed, but one day it suddenly disappeared and I panicked ^^;
environment
Rails 5.2.4.4
ruby 2.6.3
gem "refile", require: "refile/rails", github: "manfe/refile"
gem "refile-mini_magick"
Such a guy
Actual code (when a problem occurs)
<%= attachment_image_tag @member, :profile_image, :fill, 60, 60, format: "jpeg", fallback: "no_image.jpg ", class: "img-circle" %>
Actual code (after resolution)
<%= attachment_image_tag @member, :profile_image, format: "jpeg", size: "60x60", fallback: "no_image.jpg ", class: "img-circle" %>
The cause is
: fill, 60, 60
← It looks like this
↓
size:" 60x60 "
← Change to this (using lowercase x)
I solved it by changing fill
to size
. Is a story
When I look it up I changed the order because there was only one that changed the order with format, but it was displayed for the time being without changing. I don't know the reason yet, so I'll update it when I find out.
I felt once again that it is important to practice this kind of thing because it is something that cannot be understood without actually making it.
Recommended Posts