Sha256: b11438c749a7e12ffe4f1cfb243eabe6fae96c769be0dc2e5bd813c91627b571
Contents?: true
Size: 735 Bytes
Versions: 21
Compression:
Stored size: 735 Bytes
Contents
require_dependency "wbase/application_controller" module Wbase class SessionsController < ApplicationController layout 'wbase/auth' def new @user = User.new @user.email = cookies[:email] if cookies[:email] end def create @user = User.find_by_params(user_params) if @user login(@user) redirect_to '/' else @user = User.new(user_params) flash.now[:errors] = [ 'Hmm. There is not a user with that email / password combo. Try again?'] render :new end end def destroy logout redirect_to '/welcome' end private def user_params params.require(:user).permit(:email, :password) end end end
Version data entries
21 entries across 21 versions & 1 rubygems