Sha256: 1bb4d545f5e50c564f824fb6635dd176732ce580669ce24032cec1da80287a8b

Contents?: true

Size: 603 Bytes

Versions: 20

Compression:

Stored size: 603 Bytes

Contents

class UserSessionsController < ApplicationController
  
  before_filter :require_no_user, :only => [:new, :create]
  before_filter :require_user, :only => :destroy
  
  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 account_path
    else
      render :new
    end
  end
  
  def destroy
    current_user_session.destroy
    flash[:notice] = "Logout successful!"
    redirect_back_or_default new_user_session_path
  end
  
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
i0n_rails3_generators-0.2.19 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.18 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.17 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.16 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.15 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.14 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.13 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.12 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.11 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.10 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.9 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.8 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.7 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.6 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.5 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.4 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.3 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.2 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.1 lib/generators/authlogic/complete/templates/user_sessions_controller.rb
i0n_rails3_generators-0.2.0 lib/generators/authlogic/complete/templates/user_sessions_controller.rb