title: trying to find duplicate usernames in ruby
body: <p>i am trying to ensure that the username is unique when registering but im not sure how to do this</p>
  
  <p>I've tried:</p>
  
  <pre><code>validates_uniqueness_of :username 
  </code></pre>
  
  <p>but it doesnt work</p>
  
  <p>it gives me this error:
  undefined method 'validates_uniqueness_of' for <code>#&lt;UsersController:0x6c4fd2&gt;</code></p>
  
  <p>Any help please?</p>