app/views/bodega/orders/new.html.erb in bodega-0.3.0 vs app/views/bodega/orders/new.html.erb in bodega-0.4.0
- old
+ new
@@ -1,41 +1,5 @@
-<% if current_products.empty? -%>
+<% if current_order.empty? -%>
<h3><%= t 'bodega.empty_cart' %></h3>
<% else -%>
-<%= form_for(current_order, url: root_path) do |form| %>
- <table id="bodega-cart">
- <thead>
- <tr><th class="product-name" colspan="2"><%= t 'bodega.product' %></th><th class="price"><%= t 'bodega.price' %></th><th class="total" colspan="2"><%= t 'bodega.total' %></th></tr>
- </thead>
- <tbody>
- <% current_order.order_products.each do |order_product| -%>
- <tr>
- <td class="quantity-field">
- <%= number_field_tag 'products[][quantity]', order_product.quantity, class: 'quantity', max: order_product.product.max_for_sale, min: 1 %>
- </td>
- <td class="product-name">
- <%= order_product.name %>
- <%= hidden_field_tag 'products[][type]', order_product.product_type %>
- <%= hidden_field_tag 'products[][id]', order_product.product_id %>
- </td>
- <td class="price">
- <%= humanized_money_with_symbol order_product.price %>
- </td>
- <td class="subtotal">
- <%= humanized_money_with_symbol order_product.subtotal %>
- </td>
- <td class="remove">
- <%= link_to t('bodega.remove'), bodega.remove_path(product_id: order_product.identifier) %>
- </td>
- </tr>
- <% end -%>
- <tr>
- <td colspan="3"></td>
- <td><%= humanized_money_with_symbol current_order.subtotal %></td>
- <td></td>
- </tr>
- </tbody>
- </table>
- <%= button_tag t('bodega.update_cart'), id: 'bodega-update', name: :update, value: 1 %>
- <%= button_tag t('bodega.checkout'), id: 'bodega-checkout', name: :checkout, value: 1 %>
-<% end =%>
+<%= render :partial => 'cart' %>
<% end -%>