mardi 13 octobre 2020

How do I use image_tag in

I'm trying to use the code below to display a user avatar picture. This picture can be accessed by using <%= image_tag(@user.avatar) %>

I'm unsure of how to replace the src= in the code below because previous attempts to replace it ended in failure.

<img class="rounded-circle" width="45" src="https://picsum.photos/50/50" alt="">

Previously I use to used <%= image_tag(@user.avatar, style: 'width:50%') %> to show images, but I prefer the styling of the <img class> more. If anybody can help we out with this on point me into the direction of some documention on this I would greatly appreciate it

Aucun commentaire:

Enregistrer un commentaire