Add index datatable
This commit is contained in:
parent
993a54bd46
commit
22cc4c3422
1 changed files with 25 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue