Use sample, that seems cooler.

main
Simon Quigley 1 year ago
parent e30c570643
commit 86a262f11b

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

Loading…
Cancel
Save