Sha256: f90e3f8a32e7b89f319f1f680ba6858d3ae2279819cfa48d6032565c05369b19

Contents?: true

Size: 456 Bytes

Versions: 25

Compression:

Stored size: 456 Bytes

Contents

class SessionsController < ApplicationController
  
  def new
  end
  
  def create
    @user = User.authenticate(params[:session])
    if @user
      @current_user     = @user
      session[:user_id] = @user.id
      redirect_to(root_url, notice: "Successfully logged in!")      
    else
      render :new
    end
  end
  
  def destroy
    @current_user = session[:user_id] = nil
    redirect_to(root_url, notice: "Successfully logged out!")
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
blogit-1.1.2 spec/dummy/app/controllers/sessions_controller.rb
blogit-1.1.1 spec/dummy/app/controllers/sessions_controller.rb
blogit-1.1.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-1.0.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-1.0.0.rc1 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.8.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.7.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.6.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.5.1 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.5.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.8 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.7 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.6 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.5 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.4 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.3 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.2 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.1 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.4.0 spec/dummy/app/controllers/sessions_controller.rb
blogit-0.3.2 spec/dummy/app/controllers/sessions_controller.rb