Error! Error! code runs/malfunctions


#1

https://www.codecademy.com/en/courses/ruby-beginner-en-0i8v1/0/6?curriculum_id=5059f8619189a5000201fbcb

My code will run but no matter what movie title i input it still runs the else statement under the when add.

movies = Hash.new("Try Again")
movies['Badmom'] = 4
movies['Spinal_Tap'] = 2
puts "Type 'add' to add a movie"
puts "Type 'update' to update a movie"
puts "Type 'display'to display movies"
puts "Type 'delete' to delete a movie"
choice = gets.chomp
case choice
when "add"
    puts "Please enter movie title"
    title = gets.chomp
    if movies[title.to_sym].nil?
      puts "Please enter movie rating"
      rating = gets.chomp
      movies[title.to_sym] = rating.to_i
    else 
      puts "That movie already exists! It's rating is #{movies[title.to_sym]}"
    end
when "update"
    puts "Updated!"
when "display"
    puts "Movies!"
when "delete"
    puts "Deleted!"
else
    puts "Error!"
end

#2

Write these as symbols that spell out the proper name of the movie.

movies = {
  "Bad Mom" => 4,
  "Spinal Tap" => 2
}

#3

when i add the above code it gives me this error message

(ruby):2: syntax error, unexpected tASSOC, expecting '}'
"Bad_Mom" => 4,
^
(ruby):3: syntax error, unexpected tASSOC, expecting '}'
"Spinal_Tap" => 2,
^
(ruby):29: syntax error, unexpected $end, expecting '}'


#4

My bad. I just finished saying write them as symbols, then left off the :

movies = {
  :"Bad Mom" => 4,
  :"Spinal Tap" => 2
}