Rails user login issues

software development

#1

I’ve got a basic user login scheme similar to the one outlined in Agile Web Development. It works fine in another hosting environment. However, on DH I get: “wrong number of arguments (0 for 1)” when the app hits my login controller. The line that prompts the error is @user=User.new. Anyone know what this is about?

#login controller

class LoginController < ApplicationController
before_filter :authorize, :except=>:login
def add_user
if request.get?
@user=User.new
else
@user=User.new(params[:user])
if @user.save
flash "user created"
end
end
end

def login
if request.get?
session[:user_id]=nil
@user=User.new
else
@user=User.new(params[:user])
logged_in_user=@user.try_to_login
if logged_in_user
session[:user_id]=logged_in_user.id
redirect_to(:action=>“index”)
else
Flash[:notice] = "invalid login"
end
end
end

end