6. Error! Error!


This is my code for the add section

when "add"
puts "Enter a movie title."
title = gets.chomp
if movies[title].nil?
puts "What would you rate this movie?"
rating = gets.chomp
movies[title] = rating
puts "The movie #{title} has a rating of #{rating}"
puts "Sorry that movie already exists."

I get the error: Oops, try again. Make sure to test your program by choosing 'add'.


entry for variable choice should literally be the word 'add'. That works for me, at least


I believe you are forgetting to input .to_sym and .to_i

movies[title.to_sym] = rating.to_i

because you want to change the title to be a symbol, and the rating to be an integer.

I hope this helps