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 trialYang Bo
Courses Plus Student 8,503 Pointswhat's wrong in here?
I wrote the code as below for blank which I need: "authenticate(params[:password])"
if user && user.authenticate(params[:password])
I'm not sure what's wrong, it is always show incorrect. btw, could you give the notification for user? I just saw the incorrectly, but I can't see any notification.
8 Answers
Yang Bo
Courses Plus Student 8,503 Pointsit is fixed. just used method user.authenticate, doesn't has any parameter. but it is weird, it is check submitted password, no parameter to calling authenticate, just checking email? Jason Seifer
Yang Bo
Courses Plus Student 8,503 PointsJason Seifer Can you help me it?
Jason Seifer
Treehouse Guest TeacherHey Yang Bo I'm not sure I understand the question exactly. You should be calling the authenticate
method with params[:password]. Check out the documentation on the subject for more information. It should take a single parameter which is the unencrypted password.
Yang Bo
Courses Plus Student 8,503 Pointsyes, but the correctly answer is
user.authenticate
it is without params[:password]
Christopher haro
Courses Plus Student 3,372 Pointshey im having the same issue, im not sure what to try anymore i been working on this for 5 hours going though other websites and still can seem to understand it
Yang Bo
Courses Plus Student 8,503 Pointsjust use user.authenticate, don't pass any params...
Christopher haro
Courses Plus Student 3,372 Pointsive try that and its not working ,
just
" user.authenicate "
Yang Bo
Courses Plus Student 8,503 Pointsor please try
if user & user.authenicate(params[:password]) (i think it is correct, but the right awnser is next) or if user & user.authenicate (it is my previous right awnser when during course)
Christopher haro
Courses Plus Student 3,372 Pointsit didnt work
Christopher haro
Courses Plus Student 3,372 Pointsi know that's the correct. but its not working it should just be
user.authenticate
but its not working? i dont understand why its not working , the params shouldnt have to be used in the answer.
thank you, i guess its just not my day!
Christopher haro
Courses Plus Student 3,372 PointsYang Bo it final worked !!!!! thank you so much :)
Yang Bo
Courses Plus Student 8,503 Pointsyou are welcome! enjoy it :)