This is the sample application for Ruby on Rails Tutorial: Learn Web Development with Rails by Michael Hartl.
- Create random string of digits for use as a remember token
- Place the token in the browser cookies with long expiration
- Save the hash digest to db
- Place an encrypted version of user id in browser cookies
- When presented with a cookie containing user_id, find user in db => compare remember token cookie with associated hash digest from db
- Test for friendly forwarding only forward to the given URL the first time
- Integration test for all layout links (10.3.1)
All source code in the Ruby on Rails Tutorial is available jointly under the MIT License and the Beerware License. See LICENSE.md for details.
To get started with the app, clone the repo and then install the needed gems:
$ bundle install --without production
Next, migrate the database:
$ rails db:migrate
Finally, run the test suite to verify that everything is working correctly:
$ rails test
If the test suite passes, you'll be ready to run the app in a local server:
$ rails server
For more information, see the Ruby on Rails Tutorial book.