From 733fd12319c8ee9b2bacfbd2dd97256d2f2d1cbd Mon Sep 17 00:00:00 2001 From: YarekTenko Date: Tue, 28 Mar 2017 13:17:56 -0700 Subject: [PATCH] Display all Bets -All bets are displayed on /bets page. --- app/views/bets/_bet.html.erb | 7 +++++++ app/views/bets/_display_bets.html.erb | 8 +++++++- app/views/bets/index.html.erb | 6 +++++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 app/views/bets/_bet.html.erb diff --git a/app/views/bets/_bet.html.erb b/app/views/bets/_bet.html.erb new file mode 100644 index 0000000..87890d0 --- /dev/null +++ b/app/views/bets/_bet.html.erb @@ -0,0 +1,7 @@ + + <%= bet.creator_id %> + <%= bet.created_at %> + <%= bet.expires_at %> + <%= bet.bet_total %> + <%= bet.bet %> + diff --git a/app/views/bets/_display_bets.html.erb b/app/views/bets/_display_bets.html.erb index 37c7d69..a12cb53 100644 --- a/app/views/bets/_display_bets.html.erb +++ b/app/views/bets/_display_bets.html.erb @@ -5,10 +5,16 @@ Created By Created at + Expires at Total amount bet - Bet description + Bet description + + <% bets.each do |bet| %> + <%= render 'bet', bet: bet %> + <% end %> + diff --git a/app/views/bets/index.html.erb b/app/views/bets/index.html.erb index 7ade0da..b1ae90e 100644 --- a/app/views/bets/index.html.erb +++ b/app/views/bets/index.html.erb @@ -5,5 +5,9 @@

This page will display all the existing bets (25/page) and allow the user to use custom search criteria.

- <%= render 'bets/display_bets' %> +
+
+ <%= render 'display_bets', bets: @bets %> +
+
<% end %>