Could someone tell me why this Ruby on Rails solution I came up with is returning the IF statement's output regardless of what'a written in the console? (if you answer the question asked with "in Spanish" you still get a "Bonjour!" in return...
Assignment 2: Global Greetings
Ask the user how they would like to be greeted.
If they say "in French", respond with "Bonjour!"
If they say "in Spanish", respond with "Hola!"
If they say "in Afrikaans", respond with "Hallo!"
Handle all other input with "Uh, hi?"
puts "How would you like to be greated?"
greet = gets.chomp
if greet = "in French"
puts "Bonjour!"
elsif greet = "in Spanish"
puts "Hola!"
elsif greet = "in Afrikaans"
puts "Hallo!"
else
puts "Uh, hi?"
end
if greet =toif greet ==