title: ruby on rails 3 question about before_filter
body: <p>Could someone please explain for me what is happening here?</p>
  
  <p>i feel like the documentation doesnt mention a lot or describe what is happening. it just say use this method like this.</p>
  
  <p>what will happen if username and password are true, what will happen if false etc?</p>
  
  <pre><code>class AdminController &lt; ApplicationController
    USERNAME, PASSWORD = "humbaba", "5baa61e4"
  
    before_filter :authenticate
  
    private
  
    def authenticate
      authenticate_or_request_with_http_basic do |username, password|
        username == USERNAME &amp;&amp;
        Digest::SHA1.hexdigest(password) == PASSWORD
      end
    end
  end
  </code></pre>
  
  <p>thanks</p>