Skip to content

Instantly share code, notes, and snippets.

@akinsgre
Created March 6, 2012 08:10
Show Gist options
  • Save akinsgre/1984858 to your computer and use it in GitHub Desktop.
Save akinsgre/1984858 to your computer and use it in GitHub Desktop.
# check that user is logged in
def require_user
logger.info "Require User"
if current_user.nil?
session[:link_back] = request.url
redirect_to login_path
false
end
end
def require_user_no_linkback
logger.info "Require User no linkback"
if current_user.nil?
redirect_to login_path
false
end
end
class WindowsController < ApplicationController
before_filter :require_user_no_linkback, :except => [:index]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment