- add route for
new_user_path - create a
UsersControllerwith new action - create
new.html.erb - generate user model with
password_digeststring field - uncomment
gem 'bcrypt'in Gemfile and addhas_secure_passwordin User model - add
createaction in UsersController - implement logic for creating a user
- set
session[:user_id]in create action - add route for
user_path(the show action) - add
showaction in UsersController - add
show.html.erb - create
current_userhelper method in ApplicationController
- add
loginroute - create
SessionsController - add
newaction inSessionsController - add
new.html.erb - make login form in
new.html.erb - add post route for login
- add
createaction inSessionsController - implement
createaction: find user, authenticate user, set session[:user_id], and redirect
- add
logoutlink - add
logoutroute - add
destroyaction inSessionsController - clear the session and redirect