Use sample, that seems cooler.

main
Simon Quigley 1 year ago
parent e30c570643
commit 86a262f11b

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

Loading…
Cancel
Save