Skip to content

Instantly share code, notes, and snippets.

@karmatr0n
Created March 2, 2010 23:57
Show Gist options
  • Save karmatr0n/320134 to your computer and use it in GitHub Desktop.
Save karmatr0n/320134 to your computer and use it in GitHub Desktop.
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