Use sample, that seems cooler.

This commit is contained in:
Simon Quigley 2023-09-13 04:54:53 -05:00
parent e30c570643
commit 86a262f11b

View File

@ -1,9 +1,8 @@
class MoviesController < ApplicationController
def index
@movies = ["Iron Man", "Batman"]
@movies = ["Iron Man", "Batman", "Forrest Gump"]
(0..15).each{ |num|
@movies.append(num.odd? ? "Batman" : "Iron Man")
@movies.append("Forrest Gump")
@movies.append(@movies.sample())
}
end
end