Creazy for "Oops, try again. It looks like you didn't add car to the movies hash!"


here is my code:
movies = { war_3: 1,
war_2: 2
puts "What do you want (add update display delete)?"
case choice
when "add"
puts "Please input the movie's name!"
title = gets.chomp
if movies[title.to_sym].nil?
puts "Please input the rating!"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts movies
puts "The movie is exist!"
when "update"
puts "update!"
when "display"
puts "Movies!"
when "delete"
puts "Deleted!"
else puts "Error!"

input title car rating 2 ,but still let me try again! :joy:


ok ,fixed it
change 'movies[title.to_sym] = rating.to_i '
to 'movies[title] = rating'
but don't know why!~