Skip to content

Instantly share code, notes, and snippets.

@cowboycoded
Created April 12, 2011 02:22
Show Gist options
  • Save cowboycoded/914799 to your computer and use it in GitHub Desktop.
Save cowboycoded/914799 to your computer and use it in GitHub Desktop.
class ApplicationController < ActionController::Base
before_filter :init
def cacheable?
@user.blank? ? true : false
end
def init
@user = nil
@user = User.find(session[:user_id]) if session[:user_id]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment