产品列表

<%= button_to "刷新产品", 'products/get_all_products', method: :get, class: "button tiny" %>
<%= form_tag "/eric_weixin/cms/weixin/xiaodian/products/", method: :get do %>
<%= number_field_tag 'start_id', params[:start_id], placeholder: '输入起始数字ID' %>
<%= number_field_tag 'end_id', params[:end_id], placeholder: '输入终止数字ID' %>
<%= submit_tag "搜索", class: "button tiny" %>
<% end %>
<% @products.each do |product| %> <% end %>
商品ID 商品名称 商品特点 SKU信息 商品状态 公众号
<%= product.id %> <%= product.name %> <% str = product.properties %> <% a = str.gsub("=>", ":") %> <% properties = JSON.parse(a) %> <% properties.each do |property| %> <%= property['id'] + ':' %> <%= property['vid'] %>
<% end %>
<% b = product.sku_info.gsub("=>", ":") %> <% sku_infos = JSON.parse b %> <% sku_infos.each do |info| %> <%= info['id'][1, info['id'].length-1] + ':' %> <% info['vid'].each do |vid| %> <%= vid[1, vid.length-1] %> <% end %>
<% end %>
<% if product.status == 1 %> 上架 <% elsif product.status == 2 %> 下架 <% else %> error <% end %> <%= product.weixin_public_account_id %>
<%= will_paginate @collection, renderer: FoundationPagination::Rails %>