6. Error! Error!


#1

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}"
else
puts "Sorry that movie already exists."
end

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


#2

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


#3

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

movies[title.to_sym].nil?
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