has_secure_password


#1

Is has_secure_password a method or a module?

In Step 2, the instructions say to add has_secure_passwordstrong text**** to class User in the user model but I thought that method always are created by using...

def has_secure_password
    #some stuff here
end

Thanks in advance!


#2

Hi Jay,

has_secure_password is a method, automatically created by Ruby on Rails.


#3

Thanks Zeke, where does the method come from?


#4

@jaydacoder

automatically created by Ruby on Rails
- Post #2


#5

Thanks Zeke, that's what I figured after reading post 2, but what I mean is can I see it in a folder? Or is it hidden?


#6

@jaydacoder has_secure_password is actually a method created by the bcrypt gem, I was mistaken above - sorry :confused:

If you view the Gem's source code, you'll be able to see the def has_secure_password stuff, but otherwise this is the most you'll see:

# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.2'

Is that a little more helpful?


#7

It is more helpful, thank you!


#8

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.