I am looking for the corresponding tag of the following html code:
<img src="/assets/folder1/<%= @user.fullname %>.jpg" style='height:100%; width: 100%; object-fit: contain' alt="user" />
As you can see the part of the link to the picture is define by the varaiable user.fullname. The html works well but I am looking for the equivalent in Ruby.
Thanks for your support
https://apidock.com/rails/ActionView/Helpers/AssetTagHelper/image_tag
image_tag("/assets/folder1/#{ @user.fullname }.jpg", class: 'image')
CSS
img.image {
width: 100%;
height: 100%;
object-fit: contain;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.