Authlogic not active

Trying to add authlogic in a simple project but get the error;

Showing app/views/layouts/application.html.erb where line #33 raised:
undefined method `underscore' for nil:NilClass
Extracted source (around line #33):
30: <div id="mainleft">
31: <ul class="menu">
32: <li><%= nav_link "Home", "site", "index" %></li>
33: <% if current_user %>
34: <li>The site</li>
35: <% else %>
36: <li><%= nav_link "Login", "authentications", "login"

class ApplicationController < ActionController::Base
  filter_parameter_logging :password, :password_confirmation
  helper_method :current_user

    def current_user_session
      return @current_user_session if defined?(@current_user_session)
      @current_user_session = Authentication.find

    def current_user
      return @current_user if defined?(@current_user)
      @current_user = current_user_session &&

authentication model
class Authentication < Authlogic::Session::Base
  authenticate_with User

user model
class User < ActiveRecord::Base
   acts_as_authentic do |c|
    c.session_class = Authentication
    c.login_field = :login
    c.ignore_blank_passwords = false

routes in routes.rb
  map.root :controller => "site", :action => "index"
  map.resource :authentications
  map.resources :users

  map.login "login", :controller =>"authentications", :action =>
  map.logout "logout", :controller =>"authentications", :action =>

The problem is in ApplicationController
      @current_user_session = Authentication.find
Authentication is not active? I have config.gem "authlogic" in
environment.rb file.

Any ideas?

Shouldn't this be:

map.login "login", :controller =>"authentications", :action => "new"

? (Note that I changed the action to "new")

Unfortunately the problem does not appear to be a routes problem but a
‘not initialised’ authlogic problem. By changing the App.Controller
methods I have now moved the problem to the create procedure after
logging on. I managed to create a user from the console and Authlogic
filled in all the ‘special’ fields. But logging on and calling the
create session (call Authentication) causes the same error
undefined method `underscore' for nil:NilClass
which occurs when calling

def create
    @authentication =[:authentication])
     flash[:notice] = "Login successful!"
     redirect_to root_url
     render :action => :new

My App.Controller now has the session/user checking methods and cause
no problems. (so far)

    def current_user
     return @current_user if defined?(@current_user)
     @current_user = current_user_session && current_user_session.user

    def current_user_session
      return @current_user_session if defined?(@current_user_session)
      if defined?(Authentication.Find) then
       @current_user_session = Authentication.find

I am using rails 2.3.8 and Authlogic 2.1.6, and I like to try and keep
to one word descriptions of models and controls so Authentication
instead of UserSession.

fyi for people who find this thread:

I had the same issue with undefined method `underscore', and my only
solution was recreating my app from scratch, using this authlogic/rails3