vendredi 1 octobre 2021

how can i add if condition image.url.present?

I have here four images, what I want if one of those images are empty to not showing it as missing. here's an image to explain more enter image description here

   <% [@car.image.url, @car.image2.url, @car.image3.url, @car.image4.url].each do |image| %>
              <%= link_to "javascript:void(0)", data: { image: image, zoom_image: image } do %>
                <%= image_tag image%>
              <% end %>
            <% end %>

Aucun commentaire:

Enregistrer un commentaire