Skip to content

Instantly share code, notes, and snippets.

@bradylove
Created November 16, 2011 05:02
Show Gist options
  • Save bradylove/1369298 to your computer and use it in GitHub Desktop.
Save bradylove/1369298 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
# force_ssl
protect_from_forgery
helper_method :current_user
def signed_in
@signed_in = true unless session[:user_id] == nil
end
private
def current_user
@current_user ||= User.where(:id => :session[:user_id]).first if session[:user_id]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment