How do you "Add that movie/rating pair to the movies hash"


I get the message: Oops, try again.
It looks like you didn't add star wars to the movies hash!

can you check my code?

movies = { "Miracles from Heaven" => 4}
puts "Input a movie"
choice = gets.chomp
case choice
when "add"
  puts "What is the movie title?"
  title = gets.chomp
  puts "What is the rating?"
  rating = gets.chomp
  movies.push(title, rating)
  when "update"
  puts "updated"
  when "display"
  puts "Movies!"
  when "delete"
  puts "Deleted!"
      puts "Error!"


The above is an array method, for appending an array. It will not work on a hash.

movies[title.to_sym] = rating.to_i

Which lesson is this? The above may apply to a later lesson. At bare minimum, early on in the module,

movies[title] = rating

may be sufficient to pass the lesson. Will verify once I know which lesson this is.


It's Prompting: Redux! from A Night at the Movies.