Error - you didnt add to movie hash



My code for the exercise 4 does not seem to work.

Below this line, add a link to the exercise that I am stuck at.

Errors saying I did not add to movie hash keep prompting. Pls advice.

Replace this line with your code. 
movies = {
puts "Which movie do you like"
choice = gets.chomp

case choice
when "add"
    puts "Movie title"
    title = gets.chomp
    if movies[title.to_sym].nil?
    puts "Movie rating" 
    rating = gets.chomp
    movies[title.to_sym] = rating.to_i
    puts "#{title} has been added with a rating of #{rating}!"
    puts "Movie already added"

when "update"
puts "Updated!"
when "display"
puts "Movies!"
when "delete"
puts "Deleted!"
    puts "Error!"


What have you done to solve this?

Have you investigated whether it was added?
What did you add? What should have been added?
To what should you add?
What types should all those things have?
Have you read over the instructions and checked that you did each and every thing said?
..and so on


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.