Sha256: 1b9c8928dc8f5fb31a28111ecfb16e8eb1ff0315b0e4966f206926965906f3e3
Contents?: true
Size: 504 Bytes
Versions: 34
Compression:
Stored size: 504 Bytes
Contents
class SessionsController < ApplicationController def new end def create @user = User.find_by("LOWER(email)= ?", params[:email].downcase) if @user && @user.authenticate(params[:password]) session[:user_id] = @user.id redirect_to params[:return_to] || root_url, notice: "Logged in!" else flash[:warning] = "You have entered incorrect email and/or password." render :new end end def destroy session.delete(:user_id) redirect_to root_path end end
Version data entries
34 entries across 34 versions & 1 rubygems