Created
March 21, 2010 19:47
-
-
Save JonasNielsen/339517 to your computer and use it in GitHub Desktop.
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 UserSessionsController < ApplicationController | |
def new | |
@user_session = UserSession.new | |
end | |
def create | |
@user_session = UserSession.new(params[:user_session]) | |
if @user_session.save | |
flash[:notice] = "Successfully logged in." | |
redirect_to root_url | |
else | |
render :action => 'new' | |
end | |
end | |
def destroy | |
@user_session = UserSession.find | |
@user_session.destroy | |
flash[:notice] = "Successfully logged out." | |
redirect_to root_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment