michaelp0730
1/19/2015 - 6:49 PM

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 into Gaucho Football!"
		else
			flash.now.alert = "Email or Password was invalid"
			render :new
		end
	end

	def destroy
		logout
		redirect_to root_url, :notice => "You have logged out of Gaucho Football"
	end
end