Sha256: cf7e5127a04aae8e5bffe6bae4b75552caa4c8e828bb7a8f0b9c871c6ef622fd
Contents?: true
Size: 464 Bytes
Versions: 10
Compression:
Stored size: 464 Bytes
Contents
class SessionsController < ApplicationController expose(:user) { User.authenticate(params[:session]) } def new end def create 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
10 entries across 10 versions & 1 rubygems