Complete Lesson 5

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

@ -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

@ -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