Skip to content
Create a gist now

Instantly share code, notes, and snippets.

def login_attempt
authorized_user = User.authenticate(params[:username_or_email],params[:login_password])
if authorized_user
session[:user_id] =
flash[:notice] = "Wow Welcome again, you logged in as #{authorized_user.username}"
redirect_to(:action => 'home')
flash[:notice] = "Invalid Username or Password"
flash[:color]= "invalid"
render "login"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.