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 trialSebastian Velandia
24,676 Pointsdoubts about some lines of code I do not understand
- in the update method of password_resets_controller.rb this line
@user = User.find_by(password_reset_token: params[:id])
I know that that line finds the user using the rest token, what I do not understand is the params[:id]
I mean in the rspec I could notice that you send the param like this
get :edit, id: user.password_reset_token
but I do not know where do you pass id:
for make it available in the controller.
- I do not understand the way Jason creates the reset password form
form_for @user, url: password_reset_path(@user.password_reset_token), html: { method: :path}
the I do not understand the "method: :path what is it for and what does it mean?
thanks