Created
January 25, 2012 02:45
-
-
Save leemcalilly/1674304 to your computer and use it in GitHub Desktop.
app/controllers/sessions_controller.rb
This file contains hidden or 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 = login(params[:email], params[:password], params[:remember_me]) | |
if user | |
redirect_back_or_to root_url, :notice => "Logged in!" | |
else | |
flash.now.alert = "Email or password was invalid" | |
render :new | |
end | |
end | |
def destroy | |
logout | |
redirect_to root_url, :notice => "Logged out!" | |
end | |
def forgot_password | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment