<% transformations = { resize: local_assigns[:in_gallery] ? "800x600>" : "1024x768>" } %>
attachment--<%= blob.filename.extension %>"> <% if blob.variable? %> <%= image_tag blob.variant(transformations) %> <% elsif blob.previewable? %> <%= image_tag blob.preview(transformations) %> <% end %>
<% if caption = blob.try(:caption) %> <%= caption %> <% else %> <%= blob.filename %> <%= number_to_human_size blob.byte_size %> <% end %>