Created
October 20, 2010 06:36
-
-
Save baileylo/635902 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
<h1 id="page_title">Login</h1> | |
<%= render 'form' %> | |
<%= link_to 'Back', homepage_url %> |
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 | |
# GET /user_sessions/new | |
def new | |
@user_session = UserSession.new | |
end | |
# POST /user_sessions | |
def create | |
@user_session = UserSession.new(params[:user_session]) | |
if @user_session.save | |
redirect_to(homepage_url, :notice => 'Login Successful') | |
else | |
render :action => "new" | |
end | |
end | |
# DELETE /user_sessions/1 | |
def destroy | |
@user_session = UserSession.find | |
@user_session.destroy | |
redirect_to(homepage_url, :notice => 'Goodbye!') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment