classPostsController<ApplicationControllerUSER_NAME,PASSWORD="dhh","secret"before_filter:authenticate,:except=>[:index]defindexrender:text=>"Everyone can see me!"enddefeditrender:text=>"I'm only accessible if you know the password"endprivatedefauthenticateauthenticate_or_request_with_http_basicdo|user_name,password|user_name==USER_NAME&&password==PASSWORDendendend