small medium large xlarge

Generic-user-small
15 May 2010, 10:08
Sven Koesling (1 post)

Hello everybody,

as I am still a beginner I have a - maybe silly - question: How can I use the authenticate method with another model than the user model?

I have a simple application without a user model but with an library model. When I try to create a new session I get the error message:

@undefined method `authenticate’ for #@

In my sessions_controller I substituted User with Library:

@lib = Library.authenticate(params[:kuerzel], params[:passwort])@

Can anyone of You point me to what I am missing?

Thanks a lot Sven

You must be logged in to comment