var table = $('#purchases_table').DataTable();
$('#purchases_table').dataTable().fnClearTable();
<% @purchases.each_with_index do |purchase, key| %>
	var index = '<%= key +1  %>'
	var row = $('<%= j render (purchase) %>');
	row.find('td:eq(0)').text(index);
	table.row.add(row).draw();
<% end %>
