<li><%= image_tag @post.image.url,size:"180x200" %></li>
Or
<li><%= image_tag @post.image.to_s,size:"180x200" %></li>
The code that can be displayed is ↑. gem installed carrierwave and mini_magick.
<li><%= image_tag @post.image.url %></li>
If you don't define size, the image size will be huge and the browser will be messed up. Even if I remove the size specification in the erb file and try to resize it with uploader, there is no change. ↓
version :thumb do
process resize_to_fill: [50, 100]
end
By specifying the size directly in the erb file, the error that the format of the browser display itself collapses was solved. However, the image itself has stretched. I was able to confirm that mini_magick was installed, but I can't resize it no matter how I change the uploader file. Discover how to resize in uploader files.
Recommended Posts