Skip to content

Instantly share code, notes, and snippets.

def attempt_login
if authorized_user = User.authenticate(params[:username], params[:hashed_password])
# unless authorized_user.eql?(false)
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
case authorized_user.account_type
when "admin"
redirect_to :action => "index"
when "it"
redirect_to :action => "it"
def attempt_login
authorized_user = User.authenticate(params[:username], params[:hashed_password])
unless authorized_user.eql?(false)
session[:user_id] = authorized_user.id
session[:username] = authorized_user.username
case authorized_user.account_type
when "admin"
redirect_to :action => "index"
when "it"
redirect_to :action => "it"