Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby User Authentication with Rails Password Hashing and Sign In Testing Session Creation

Can't get user.authenticate question right on quiz

I re-watched the video and copied my working code directly from sublime into the answer box as:

if user && user.authenticate(params[:password])

..where everything after user. is expected as the answer and it keeps saying it is wrong. Not sure why ??

1 Answer

Hi John,

Your answer is correct but the question need only first word which is "authenticate" without adding others.

user = User.find_by(email: params[:email])
if user && user.authenticate

-Salman

Wow, thanks Salman. I wish they would be more specific in the question or at least write the 'answer checking' code to accept the long version too. The answer they want is only partial and wont actually work in the model