index.html.erb 947 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <h1>Pages#index</h1>
  2. <p>Find me in app/views/pages/index.html.erb</p>
  3. <table class="table table-bordered table-striped table-hover">
  4. <tr>
  5. <th>#</th>
  6. <th>訂單</th>
  7. <th>明細</th>
  8. </tr>
  9. <% @orders.each.with_index(1) do |order,index| %>
  10. <tr>
  11. <td><%= index %></td>
  12. <td><%= order.OrderNumber %></td>
  13. <td>
  14. <table class="table table-striped table-hover">
  15. <tr>
  16. <th>#</th>
  17. <th>型號</th>
  18. <th>單價</th>
  19. <th>數量</th>
  20. <th>折扣</th>
  21. <th>小計</th>
  22. </tr>
  23. <% order.lines.each do |line| %>
  24. <tr>
  25. <td><%= line.LineNum %></td>
  26. <td><%= line.ProdId %></td>
  27. <td><%= line.UnitPrice %></td>
  28. <td><%= line.Quantity %></td>
  29. <td><%= line.Discount %>%</td>
  30. <td><%= line.SubTotal %></td>
  31. </tr>
  32. <% end %>
  33. </table>
  34. </td>
  35. </tr>
  36. <% end %>
  37. </table>