Sha256: 6da61d4d8237303fe59b698cd4ddef53b29710c367040bf696706121aa8b5035
Contents?: true
Size: 553 Bytes
Versions: 10
Compression:
Stored size: 553 Bytes
Contents
# Creates or destroys {Editor} sessions. class Manifest::SessionsController < ApplicationController layout 'manifest/sessions' def new end def create editor = Editor.find_by_email(params[:email]) if editor && editor.authenticate(params[:password]) session[:editor_id] = editor.id redirect_to manifest_path, notice: 'Logged in!' else flash.now.alert = 'Email or password is invalid' render 'new' end end def destroy session[:editor_id] = nil redirect_to new_manifest_session_path end end
Version data entries
10 entries across 10 versions & 1 rubygems