Skip to content

Commit

Permalink
Display all Bets
Browse files Browse the repository at this point in the history
-All bets are displayed on /bets page.
  • Loading branch information
LeonTenko committed Mar 29, 2017
1 parent d3085c5 commit 19e50bd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 15 deletions.
7 changes: 7 additions & 0 deletions app/views/bets/_bet.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<tr>
<td class="col-md-2"><%= bet.creator_id %></td>
<td class="col-md-2"><%= bet.created_at %></td>
<td class="col-md-2"><%= bet.expires_at %></td>
<td class="col-md-2"><%= bet.bet_total %></td>
<td class="col-md-4"><%= bet.bet %></td>
</tr>
14 changes: 0 additions & 14 deletions app/views/bets/_display_bets.html.erb

This file was deleted.

23 changes: 22 additions & 1 deletion app/views/bets/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,26 @@
<h4>This page will display all the existing bets (25/page) and allow the user to use custom search criteria.</h4>
</div>
</div>
<%= render 'bets/display_bets' %>
<div class="d-flex flex-column">
<div class="p-2">
<div class="row">
<div class="col col-lg-12">
<table class="table table-hover">
<thead class="thead-default">
<tr>
<th class="col-md-2">Created By</th>
<th class="col-md-2">Created at</th>
<th class="col-md-2">Expires at</th>
<th class="col-md-2">Total amount bet</th>
<th class="col-md-4">Bet description</th>
</tr>
</thead>
<tbody>
<%= render @bets%>
</tbody>
</table>
</div>
</div>
</div>
</div>
<% end %>

0 comments on commit 19e50bd

Please sign in to comment.