Created
June 8, 2017 03:25
-
-
Save anndoko/ca731f754304b48bb62a9bb98615e812 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
<!-- 商品圖片 --> | |
<div class="row"> | |
<% if @product_images.present? %> | |
<!-- 第一張圖為 medium 尺寸大圖 --> | |
<div class="col-md-12"> | |
<%= image_tag(@product_images.first.image.thumb.url, class: 'main-image') %> | |
</div> | |
<% @product_images.each_with_index do |p| %> | |
<!-- 顯示所有商品圖片 - other 尺寸小圖 --> | |
<div class="col-md-2 col-sm-4 col-xs-6 image-box"> | |
<%= image_tag(p.image.thumb.url, class: 'list-image') %> | |
</div> | |
<% end %> | |
<% else %> | |
<%= image_tag('http://placehold.it/300x300&text=No Pic', class: 'thumbnail') %> | |
<% end %> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment