tap/app/views/orders/_order.html.erb

18 lines
409 B
Text
Raw Normal View History

2014-11-09 22:53:39 +01:00
<li id="order-<%= order.id %>">
2014-11-25 02:01:57 +01:00
2014-11-09 22:53:39 +01:00
<span class="products"><%= order.products %></span>
<span class="timestamp">
Posted <%= time_ago_in_words(order.created_at) %> ago.
</span>
2014-11-23 21:12:31 +01:00
</li>
2014-11-25 02:01:57 +01:00
<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>