1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/app/views/active_storage/blobs/_blob.html.erb

17 lines
625 B
Text
Raw Normal View History

<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
<% if blob.variable? %>
<%= image_tag blob.variant(resize: "1024x768>") %>
<% elsif blob.previewable? %>
<%= image_tag blob.preview(resize: "1024x768>") %>
<% end %>
2018-02-13 15:07:29 -05:00
<figcaption class="attachment__caption">
<% if caption = blob.try(:caption) %>
<%= caption %>
<% else %>
<span class="attachment__name"><%= blob.filename %></span>
<span class="attachment__size"><%= number_to_human_size blob.byte_size %></span>
<% end %>
</figcaption>
2018-02-13 15:07:29 -05:00
</figure>