245 shaares
119 liens privés
119 liens privés
class User < ApplicationRecord
has_secure_token
end
No more headache with tokens in rails 5.
Well ...not like it was a huge deal, but nice addition. Goes in the 'token' field, by default.
class User < ApplicationRecord
has_secure_token :password_reset_token
end
if you need a token in a password_reset_token field. Must be a string.