DEFEN UPDAT Kata Sandi Perbarui

# /!\ Security /!\

def update_password
  @user = current_user
  if @user.update(user_params)
    # Sign in the user by passing validation in case their password changed
    bypass_sign_in(@user)
    redirect_to root_path
  else
    render :edit
  end
end
Lioruby