<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hello,I have this :
movies = {harry_potter: 9 }
puts "Wat wil u doen : "
choice = gets.chomp
case choice
when "add"
puts "welke film wilt u toevoegen"
title = gets.chomp
puts "welke rating krijgt deze film"
rating = gets.chomp
if movies[title.to_sym].nil?
movies[title.to_sym] = rating.to_i
puts "Deze film is toegevoegd"
else
puts "Deze flim is al toegevoegd"
end
when "update"
puts "welke film wilt u wijzigen"
title = gets.chomp
if movies[title.to_sym].nil?
puts "Deze film is niet in de database"
else
puts "Welke rating moet de film nu krijgen"
rating = gets.chomp
movies[title.to_sym] = rating.to_i
puts "Deze film heeft nu als rating : #{rating}. "
end
when "display"
movies.each { |movie,rating| puts "#{movie}:#{rating}"}
when "delete"
puts "Deleted!"
else
puts "Error!"
end
But when I choose display. I see this output :
Wat wil u doen :
display
harry_potter:9
{:harry_potter=>9}
but still I see this error :
Oops, try again. It looks like your 'puts' doesn't include harry_potter: 9.
Roelof