Created
August 18, 2012 17:52
-
-
Save keeperofthenecklace/3388729 to your computer and use it in GitHub Desktop.
spec/controller/sessions_controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SessionsController < ApplicationController | |
def new | |
end | |
def create | |
user = User.find_by_email(params[:session][:email]) | |
if user && user.authenticate(params[:session][:password]) | |
sign_in user | |
redirect_to user | |
else | |
flash.now[:error] = 'Invalid email/password combination' | |
render 'new' | |
end | |
end | |
def destroy | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment