title: ruby gets 'enter key'
body: <p>How can I recognise input of the <kbd>Enter</kbd> key? The following code won't work for me</p>
  
  <pre><code>puts 'press the enter key'
  names = gets
  
  if names == '\n'
      puts 'yay'
  end
  </code></pre>