I was just working my way pretty carefully through the getting started
tutorial and I've hit an unusual snag that I can't make any sense of.
After adding the authenticate before filter to my posts controller I
was presented with this error message:
undefined method `Â Â before_filter' for PostsController:Class
If I delete the line that contains the before_filter then everything
works as expected, minus authentication of course. The authenticate
method is this:
authenticate_or_request_with_http_basic do |user_name, password|
user_name == 'admin' && password == 'password'
And the before_filter line is this:
before_filter :authenticate, :except => [:index, :show]
If anybody can tell me what is going on I would be very appreciative.
The getting started tutorial that I am referring to is here: