title: Breaking a loop when a user types a certain input
body: <p>So I'm trying to break a loop when a user type <code>done</code> and from there jump into another method called "survey" that asks a few leftover questions.</p>
  
  <p>This is what I have a the moment:</p>
  
  <pre><code>def survey
      puts "For how many years have you had these allergies?"
      name = gets.chomp.to_i
  
      puts "When was your last allergy reaction?"
      reaction = gets.chomp.to_i
  end
  
  def allergies
  
      puts "Please enter all your allergies. When you are finished, type 'done'."
      allergy = gets.chomp.downcase!
  
      while allergy != "done"
  
          # Format the loop so that when the user types 'done'
          # The loop breaks and we go to the 'survey' method
  
          allergy = gets.chomp.downcase
          survey
          if allergy == "nuts"
              puts "Beware! The food item contains peanuts!"
              break
          end
      end
  end
  
  allergies
  </code></pre>
  
  <p>At the moment it just lets me type in one allergy and thenk skips right into the survey method. How can I change this so I can keep inputting allergies until I either type "nuts" or "done"?</p>