Prevent duplicates. Refreshing the page successfully gives a different result every time.

main
Simon Quigley 8 months ago
parent 86a262f11b
commit 57bc2cfac8

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

Loading…
Cancel
Save