Skip to content

Commit e009430

Browse files
authored
Merge pull request rails#53297 from ykpythemind/patch-1
[ci skip] Update example to use ActiveRecord::SecurePassword.authenticate_by method
2 parents dcbd0fa + a055713 commit e009430

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

guides/source/action_controller_overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ To store something in the session, just assign it to the key like a hash:
526526
class LoginsController < ApplicationController
527527
# "Create" a login, aka "log the user in"
528528
def create
529-
if user = User.authenticate(params[:username], params[:password])
529+
if user = User.authenticate_by(email: params[:email], password: params[:password])
530530
# Save the user ID in the session so it can be used in
531531
# subsequent requests
532532
session[:current_user_id] = user.id

0 commit comments

Comments
 (0)