Skip to content

Instantly share code, notes, and snippets.

View jcuervo's full-sized avatar
💭
I may be slow to respond.

Chard Gonzales jcuervo

💭
I may be slow to respond.
View GitHub Profile
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"