Guest User

Untitled

a guest
May 25th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. <h1 class="block">Listing products</h1>
  2. <div class="column1-unit">
  3.  
  4. <% form_for(@products) do |f| %>
  5. <table>
  6. <tr>
  7. <th class="top" scope="col">Name</th>
  8. <th class="top" scope="col">Vendor</th>
  9. <th class="top" scope="col">Min</th>
  10. <th class="top" scope="col">Reorder</th>
  11. <th class="top" scope="col">Price</th>
  12. <th class="top" scope="col">Cost</th>
  13. <th class="top" scope="col">Order</th>
  14. </tr>
  15. <% for product in @products %>
  16. <% fields_for product do |f| %>
  17. <tr>
  18. <td><%= f.label "name" %><%= f.text_field "name"</td>
  19. <% fields_for product.vendor.name do |vendor| %>
  20. <td><%= vendor.label "name" %></td>
  21. <% end %>
  22. <td><%= f.label "min" %></td>
  23. <td><%= f.label "reorder" %></td>
  24. <td><%= f.label "price" %></td>
  25. <td><%= f.label "cost" %></td>
  26. <td><%= f.text_field "tobeordered" %></td>
  27. <td><%= link_to 'Show', product %> <%= link_to 'Edit', edit_product_path(product) %> <%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %></td>
  28. </tr>
  29. <% end %>
  30. <% end %>
  31. </table>
  32. <%= f.submit "Submit" %>
  33. <%= link_to 'New product', new_product_path %>
  34. <% end %>
  35. </div>
  36.  
  37. <hr class="clear-contentunit" />
Add Comment
Please, Sign In to add comment