Created
July 17, 2019 11:08
-
-
Save crivotz/5228cf58c00911b29a1493d11c6c02bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @post.uploads.each do |upload| %> | |
<% if upload.variable? %> | |
<%= link_to image_tag(upload.variant(resize: "400x400")), upload %> | |
<% elsif upload.previewable? %> | |
<%= link_to image_tag(upload.preview(resize: "400x400")), rails_blob_path(upload, disposition: :attachment) %> | |
<% elsif upload.image? %> | |
<%= link_to image_tag(upload, width: 400), upload %> | |
<% else %> | |
<%= link_to upload.filename, rails_blob_path(upload, disposition: :attachment) %> | |
<% end %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment