Sha256: 0df57caf1450a9ecb010bd55717638d32aca601c7074736436c38d2cc8bdea09

Contents?: true

Size: 637 Bytes

Versions: 1

Compression:

Stored size: 637 Bytes

Contents

class UserSessionsController < ApplicationController
  before_filter :require_user, :only => :destroy
#  skip_before_filter  :authorisation
#  before_filter :require_no_user, :only => [:new, :create]
  
  def new
    @user_session = UserSession.new
  end
  
  def create
    @user_session = UserSession.new(params[:user_session])
    if @user_session.save
      flash[:notice] = "Login successful!"      
      redirect_back_or_default root_url
    else
      render :action => :new
    end
  end
  
  def destroy
    current_user_session.destroy
    flash[:notice] = "Logout successful!"
    redirect_back_or_default root_url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
qcore-1.2.0 app/controllers/user_sessions_controller.rb