Ruby on Rails - has_secure_token in ruby on rails- ruby on rails tutorial - rails guides - rails tutorial - ruby rails
has_secure_token in ruby on rails
Create User Model
Now, when you create a new user a token and auth_token are automatically generated.
You can update the tokens using regenerate_token and regenerate_auth_token.
user.regenerate_token # => true user.regenerate_auth_token # => true