From 94f206d9911b2bf499ae480647f2fa4f14839339 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 25 Sep 2023 13:33:10 -0500 Subject: [PATCH] Complete Lesson 5 --- app/controllers/movies_controller.rb | 8 ++++---- app/views/movies/index.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/movies_controller.rb b/app/controllers/movies_controller.rb index 34d9cbd..3b969b4 100644 --- a/app/controllers/movies_controller.rb +++ b/app/controllers/movies_controller.rb @@ -1,8 +1,8 @@ class MoviesController < ApplicationController def index - @choices, @movies = ["Iron Man ⎊", "Batman 🦇", "Forrest Gump 🏃"], [] - (0..15).each{ |num| - @movies.append(@choices.sample()) - } + @choices, @movies = Movie.all, [] + (0..15).each{ |num| + @movies.append(@choices.sample()) + } end end diff --git a/app/views/movies/index.html.erb b/app/views/movies/index.html.erb index 253f161..106891a 100644 --- a/app/views/movies/index.html.erb +++ b/app/views/movies/index.html.erb @@ -5,7 +5,7 @@