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 trialJohn Martens
8,689 PointsCan'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
Salman Akram
Courses Plus Student 40,065 PointsHi 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
John Martens
8,689 PointsJohn Martens
8,689 PointsWow, 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