diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index b3d77cc..0c07f2c 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -1,2 +1,6 @@ class ReviewsController < ApplicationController + def index + @movie = Movie.find(params[:movie_id]) + @reviews = @movie.reviews + end end diff --git a/app/views/movies/show.html.erb b/app/views/movies/show.html.erb index d54d205..a321526 100644 --- a/app/views/movies/show.html.erb +++ b/app/views/movies/show.html.erb @@ -7,6 +7,9 @@
<%= @movie.description %>
diff --git a/app/views/reviews/index.html.erb b/app/views/reviews/index.html.erb new file mode 100644 index 0000000..95a8d44 --- /dev/null +++ b/app/views/reviews/index.html.erb @@ -0,0 +1,18 @@ ++ <%= review.name %> + + <%= time_ago_in_words(review.created_at) %> ago + +
++ <%= review.comment %> +
+