2014-11-09 22:53:39 +01:00
|
|
|
<li id="order-<%= order.id %>">
|
2014-11-25 02:01:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-11-25 13:09:55 +01:00
|
|
|
<span class="products"></span>
|
2014-11-09 22:53:39 +01:00
|
|
|
<span class="timestamp">
|
2014-11-25 13:09:55 +01:00
|
|
|
Ordered <%= time_ago_in_words(order.created_at) %> ago.
|
2014-11-09 22:53:39 +01:00
|
|
|
</span>
|
2014-11-23 21:12:31 +01:00
|
|
|
</li>
|
2014-11-25 02:01:57 +01:00
|
|
|
|
2014-11-25 13:09:55 +01:00
|
|
|
|
2014-11-25 02:01:57 +01:00
|
|
|
<script charset="utf-8">
|
2014-11-25 13:09:55 +01:00
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
//$(".products").empty()
|
|
|
|
var op = '<%=order.products%>'.replace(/"/g , "\"" );
|
|
|
|
console.log(op);
|
|
|
|
var products = JSON.parse(op);
|
|
|
|
console.log(products)
|
|
|
|
|
|
|
|
$.each(products, function(i, product) {
|
|
|
|
$(".products").append("<p> - "+ i +": "+ product.number_of +"</p>");
|
|
|
|
});
|
2014-11-25 02:01:57 +01:00
|
|
|
});
|
|
|
|
</script>
|