public
Created

  • Download Gist
sessions_controller.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
class SessionsController < ApplicationController
def login
#Login Form
end
def login_attempt
authorized_user = User.authenticate(params[:username_or_email],params[:login_password])
if authorized_user
flash[:notice] = "Wow Welcome again, you logged in as #{authorized_user.username}"
redirect_to(:action => 'home')
else
flash[:notice] = "Invalid Username or Password"
flash[:color]= "invalid"
render "login"
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.