tap/app/views/orders/_order.html.erb
2014-11-25 02:01:57 +01:00

17 lines
409 B
Text

<li id="order-<%= order.id %>">
<span class="products"><%= order.products %></span>
<span class="timestamp">
Posted <%= time_ago_in_words(order.created_at) %> ago.
</span>
</li>
<script charset="utf-8">
var products = JSON.stringify(<%=order.products%> );
jQuery.each(products, function(i, product) {
$(".products").append("<p> - "+ i +": "+ product.number_of +"</p>");
});
</script>