aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorGeorge Claghorn <george@basecamp.com>2018-10-07 23:51:21 -0400
committerGeorge Claghorn <george@basecamp.com>2018-10-07 23:51:26 -0400
commitdec130a80c4947f749782347d03469bd7358c43b (patch)
treed8b3a40fad37926198d37b6d6c22affca7a5ad78 /app
parente26626f4f9c8a0ba559f238a54adb0de5ce79f7c (diff)
downloadrails-dec130a80c4947f749782347d03469bd7358c43b.tar.gz
rails-dec130a80c4947f749782347d03469bd7358c43b.tar.bz2
rails-dec130a80c4947f749782347d03469bd7358c43b.zip
Use the ASt representation API
Diffstat (limited to 'app')
-rw-r--r--app/views/active_storage/blobs/_blob.html.erb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/views/active_storage/blobs/_blob.html.erb b/app/views/active_storage/blobs/_blob.html.erb
index 6e4105d5cf..049f57e804 100644
--- a/app/views/active_storage/blobs/_blob.html.erb
+++ b/app/views/active_storage/blobs/_blob.html.erb
@@ -1,9 +1,6 @@
-<% transformations = { resize: local_assigns[:in_gallery] ? "800x600>" : "1024x768>" } %>
<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> attachment--<%= blob.filename.extension %>">
- <% if blob.variable? %>
- <%= image_tag blob.variant(transformations) %>
- <% elsif blob.previewable? %>
- <%= image_tag blob.preview(transformations) %>
+ <% if blob.representable? %>
+ <%= image_tag blob.representation(resize_to_fit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
<% end %>
<figcaption class="attachment__caption">