@ -1,9 +1,6 @@
class MoviesController < ApplicationController
def index
@choices, @movies = Movie.all, []
(0..10).each{ |num|
@movies.append(@choices.sample())
}
@movies = Movie.released
end
def show
@movie = Movie.find(params[:id])
@ -2,4 +2,7 @@ class Movie < ApplicationRecord
def flop?
total_gross.blank? || total_gross < 225_000_000
def self.released
where("released_on < ?", Time.now).order(released_on: :desc)