From 144b2ca04f148f6f4f40f1ec7e1a4ac6d840cfc9 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Mon, 25 Sep 2023 15:00:10 -0500 Subject: [PATCH] Complete Lesson 10 --- app/controllers/movies_controller.rb | 3 +++ app/views/movies/show.html.erb | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 app/views/movies/show.html.erb diff --git a/app/controllers/movies_controller.rb b/app/controllers/movies_controller.rb index 8f2b634..915dc61 100644 --- a/app/controllers/movies_controller.rb +++ b/app/controllers/movies_controller.rb @@ -5,4 +5,7 @@ class MoviesController < ApplicationController @movies.append(@choices.sample()) } end + def show + @movie = Movie.find(params[:id]) + end end diff --git a/app/views/movies/show.html.erb b/app/views/movies/show.html.erb new file mode 100644 index 0000000..2bd7a2d --- /dev/null +++ b/app/views/movies/show.html.erb @@ -0,0 +1,17 @@ +
+
+

<%= @movie.title %>

+

+ <%= year_of(@movie) %> • <%= @movie.rating %> +

+

+ <%= @movie.description %> +

+ + + + + +
Total Gross:<%= total_gross(@movie) %>
+
+