Complete Lesson 5

main
Simon Quigley 1 year ago
parent 77465c4ab0
commit 94f206d991

@ -1,6 +1,6 @@
class MoviesController < ApplicationController
def index
@choices, @movies = ["Iron Man ⎊", "Batman 🦇", "Forrest Gump 🏃"], []
@choices, @movies = Movie.all, []
(0..15).each{ |num|
@movies.append(@choices.sample())
}

@ -5,7 +5,7 @@
<ul>
<% @movies.each do |movie| %>
<li><%= movie %></li>
<li><%= movie.title %> (<%= movie.rating %>): <%= number_to_currency(movie.total_gross, precision: 0) %></li>
<% end %>
</ul>
</div>

Loading…
Cancel
Save