Skip to content

Instantly share code, notes, and snippets.

@UserAd
Created August 21, 2010 17:56
Show Gist options
  • Save UserAd/542639 to your computer and use it in GitHub Desktop.
Save UserAd/542639 to your computer and use it in GitHub Desktop.
module ActsAsAdmin
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def acts_as_admin
layout lambda{ |c|
if c.request.xhr?
nil
else
'admin2'
end
}
#ACL 9 rules here
before_filter :require_user
access_control do
allow :admin
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment