Reputation: 19
I have a column called resolution_image type boolean in the paperclip images table. I want to show the image where the field resolution_image is true, how do i show this image?
Upvotes: 0
Views: 47
Reputation: 5239
Need some more details on your specific naming convention, but let's assume the following:
model_with_image_attachment
attachment_name
This would display the image when the resolution_image
attribute is true
:
<%= image_tag model_with_image_attachment.attachment_name.url if model_with_image_attachment.resolution_image %>
Upvotes: 0