Sha256: fd90a24632f98b13af5eb3919290c65b86a7e7d44b7e5022deda5622236a1483
Contents?: true
Size: 506 Bytes
Versions: 26
Compression:
Stored size: 506 Bytes
Contents
class SessionsController < ApplicationController def new end def create @user = User.find_by_name(params[:session][:name]) if @user && @user.authenticate(params[:session][:password]) sign_in(@user, permanent: params[:session][:remember_me] == "1") redirect_to articles_path, success: "Signed in" else flash.now[:error] = "Incorrect user/password" render 'new' end end def destroy sign_out redirect_to root_path, success: "Signed out" end end
Version data entries
26 entries across 26 versions & 1 rubygems