Reputation: 5
<% if item.image.attached? %>
<image src="<%=(url_for(item.image), :class => "itemholsIm") %>">
<% end %>
How should it be done?
Upvotes: 0
Views: 210
Reputation: 866
You can use img_tag helper.
<%= image_tag(item.image, class: "itemholsIm") %>
Upvotes: 2
Reputation: 26
You have to put the CSS class out of the <%= %>
Try this :
<% if item.image.attached? %>
<image src="<%=(url_for(item.image)%>" class="itemholsIm">
<% end %>
Upvotes: 1