8 display


#1

here is my code:

movies = {
avengers: 4

}
puts"--add add a movie"
puts"--update"
puts"--display"
puts"--delete"
choice = gets.chomp

case choice
when "add"
puts"Enter movie title: "
title = gets.chomp
puts"Movie rating: "
rating = gets.chomp
title = title.to_sym
rating = rating.to_i
movies[title] = rating
if movies[title] = rating == false
movies + movies[title] = rating
else
puts "That movie already exists"
end
when "update"
puts"Enter a movie title: "
title = gets.chomp

if movies[title] == nil
    puts"That movie is not in the list."
else
    puts"New rating: "
end

when "display"
movies.each do |movie,rating|
puts " #{movie}: #{rating}. "
end

when "delete"
puts "Deleted!"
else
puts "Error"
end

it give me the error "You didn't display avengers: 4"
but in the console it printed out "avengers 4"

what is happening????


#2

i figured it out
it can't be " #{movie}: #{rating} "
it HAS to be "#{movie}: #{rating}"