Complete Lesson 8

main
Simon Quigley 8 months ago
parent eb029fb99b
commit 96afc71d7a

@ -1,7 +1,7 @@
class MoviesController < ApplicationController class MoviesController < ApplicationController
def index def index
@choices, @movies = Movie.all, [] @choices, @movies = Movie.all, []
(0..15).each{ |num| (0..10).each{ |num|
@movies.append(@choices.sample()) @movies.append(@choices.sample())
} }
end end

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Bootcamp</title> <title>Movie Selections</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<%= csp_meta_tag %> <%= csp_meta_tag %>
@ -12,6 +12,19 @@
</head> </head>
<body> <body>
<%= yield %> <header>
<div class="alert alert-primary" role="alert">
<h1>The only movies that actually matter</h1>
</div>
</header>
<div class="content">
<%= yield %>
</div>
<footer>
<p>
Copyright © <%= Time.now.year %>
<%= link_to "Skyleaf Design", "https://skyleafdesign.com/" %>
</p>
</footer>
</body> </body>
</html> </html>

@ -1,7 +1,4 @@
<div class="container"> <div class="container">
<div class="alert alert-primary" role="alert">
<h1>The only movies that actually matter</h1>
</div>
<ul> <ul>
<% @movies.each do |movie| %> <% @movies.each do |movie| %>

Loading…
Cancel
Save