<% # headmin/thumbnail # # ==== Required parameters # * +file+ - Name of the attribute of the form model # # ==== Optional parameters # * +width+ - Width of the thumbnail. Set to nil to fill according to the original aspect ratio # * +height+ - Height of the thumbnail. Set to nil to fill according to the original aspect ratio # * +icon+ - Force icon to be shown instead of a thumbnail # # ==== References # https://headmin.dev/docs/thumbnail # # ==== Examples # Basic version # <%= render "headmin/thumbnail", file: file %#> # # Custom size (200px x 100px) # <%= render "headmin/thumbnail", file: file, width: 200, height: 100 %#> # # Custom (bootstrap) icon # <%= render "headmin/thumbnail", file: file, icon: "file-earmark-excel" %#> thumbnail = Headmin::ThumbnailView.new(local_assigns) %>
<% if thumbnail.variable? && !thumbnail.icon? %> <%= image_tag(thumbnail.file.variant(thumbnail.variant_options)) %> <% else %> <%= bootstrap_icon(thumbnail.icon_name, class: "h-thumbnail-icon") %> <% end %>