Created
March 2, 2010 23:57
-
-
Save karmatr0n/320134 to your computer and use it in GitHub Desktop.
This file contains 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 | |
include SslRequirement | |
ssl_required :create, :new, :recover_password if Rails.env == "production" | |
skip_before_filter :require_login, :only => [:new, :create] | |
layout 'session' | |
respond_to :html | |
def new | |
respond_with(@session = UserSession.new) | |
end | |
def create | |
respond_with(@session = UserSession.create(params[:user_session]), :status => :created, :location => dashboard_path) | |
end | |
def destroy | |
current_user_session.destroy | |
redirect_to new_session_url | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment