Sha256: f90e3f8a32e7b89f319f1f680ba6858d3ae2279819cfa48d6032565c05369b19
Contents?: true
Size: 456 Bytes
Versions: 25
Compression:
Stored size: 456 Bytes
Contents
class SessionsController < ApplicationController def new end def create @user = User.authenticate(params[:session]) if @user @current_user = @user session[:user_id] = @user.id redirect_to(root_url, notice: "Successfully logged in!") else render :new end end def destroy @current_user = session[:user_id] = nil redirect_to(root_url, notice: "Successfully logged out!") end end
Version data entries
25 entries across 25 versions & 1 rubygems