Add index datatable

This commit is contained in:
Ilion Beyst 2015-09-08 16:16:19 +02:00
parent 993a54bd46
commit 22cc4c3422

View file

@ -1,3 +1,27 @@
<table id="transactions" class="display">
<thead>
<tr>
<th>id</th>
<th>debtor</th>
<th>creditor</th>
<th>amount</th>
</tr>
</thead>
Oh cool a list of transactions
<tbody>
<% @transactions.each do |transaction| %>
<tr>
<td><%= transaction.id %></td>
<td><%= transaction.debtor.name %></td>
<td><%= transaction.creditor.name %></td>
<td><%= transaction.amount%></td>
</tr>
<% end %>
</tbody>
</table>
<script>
$(document).ready(function() {
$('#transactions').DataTable();
});
</script>