problem with authenticate

The example doesn't work as described for me; not sure if I haven't followed it right, or there's a problem with the code. Can someone help me to determine what the problem is.

Specifically, after adding the authentication code to the ApplicationController , with this code:

  def authenticate     authenticate_or_request_with_http_basic do |user_name, password|       user_name == 'admin' && password == 'password'     end   end

And then to the PostsController, with this line:

before_filter :authenticate, :except => [:index, :show]

The guide says that "we want the user to be authenticated on every action, except for index and show", however, it only authenticates on the new post and edit options; it doesn't authenticate on destroy.

Sincere thanks in advance to anyone who can help shed light on this issue! :slight_smile:

Here's the full code of each:


some error messages in the log?