Created
March 31, 2019 22:41
-
-
Save gugutz/e2346d6aacc46eb7cc6979c5327257d2 to your computer and use it in GitHub Desktop.
rails authentication with devise
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
updated: 31/03/2019 with rails 5.2 | |
add `gem 'devise'` to gemfile | |
bundle install | |
rails g devise:install | |
Ensure you have defined default url options in your environments files. Open up config/environments/development.rb and add this line: | |
```config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }``` | |
Ensure the default route is settled in config/routes, for instance: | |
```root to home#index``` | |
Ensure to have flash messages in app/views/layouts/application.html.erb | |
```rails g devise user | |
rails db:migrate``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment