Error! Error! (Syntax error)

ruby

#1

I keep getting syntax error regarding this task? Help!

for easier editing -

movies = {
'the matrix' => '7',
'the incredibles' => '8',
'interstellar' => '9',
}
puts "Type movie"
choice = gets.chomp
case choice
when 'add'
puts "Add Title"
title = gets.chomp
if movies[title].nil?
puts "Type rating"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "The movie #{title} has been added a rating of #{rating."
else
puts "The movie #{title} already exists. Its rating is #{movies[title.to_sym]}"
end
when 'update'
puts "Updated!"
when 'display'
puts "Movies!"
when 'delete'
puts "Deleted!"
else
puts "Error!"
end


#2

It looks like you don't have qa closing '}' after rating


#3

Thank you! Now it works! :slightly_smiling: