Sha256: 4a6b452cc1e79d30677e35a0839c198c71aa816b67a50bd6b6c2a8b4553cadcc
Contents?: true
Size: 784 Bytes
Versions: 10
Compression:
Stored size: 784 Bytes
Contents
class SessionsController < ApplicationController layout 'login' before_filter :redirect?, :only => [:new, :create] before_filter :redirect_to_new, :only => [:index, :show] def new @session = UserSession.new end def create if (@session = UserSession.create(params[:session])).valid? flash[:notice] = t('sessions.login_successful') if refinery_user? redirect_back_or_default(admin_root_url) else render :action => 'new' end end def destroy current_user_session.destroy if logged_in? redirect_to(root_url) end protected def redirect? if refinery_user? redirect_to admin_root_url elsif logged_in? redirect_to root_url end end def redirect_to_new redirect_to :action => "new" end end
Version data entries
10 entries across 10 versions & 1 rubygems