Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created January 25, 2012 02:45
Show Gist options
  • Save leemcalilly/1674304 to your computer and use it in GitHub Desktop.
Save leemcalilly/1674304 to your computer and use it in GitHub Desktop.
app/controllers/sessions_controller.rb
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