Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!-- 商品圖片 -->
<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
You can’t perform that action at this time.