Sha256: 1661bacb59932f81c45db8f35a445dc7736786fa64f519e69487faf4b5f87a2f

Contents?: true

Size: 847 Bytes

Versions: 1

Compression:

Stored size: 847 Bytes

Contents

module Caseadilla
  class CaseadillaUserSessionsController < Caseadilla::CaseadillaController
    
    skip_before_action :require_sign_in, :only => [:new, :create]
    before_filter :requires_no_session_user, :except => [:destroy]
  
    layout 'caseadilla_auth'
  
    def new
      @user_session = nil
    end
  
    def create
      @user_session = nil
      if @user_session.save
        redirect_back_or_default :controller => :caseadilla, :action => :index
      else
        render :action => :new
      end
    end
  
    def destroy
      current_user_session.destroy
      redirect_back_or_default new_caseadilla_user_session_url
    end

  private
  
    def requires_no_session_user
      if current_user
        redirect_to :controller => :caseadilla, :action => :index
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
caseadilla-0.0.1 app/controllers/caseadilla/caseadilla_user_sessions_controller.rb