Created
June 10, 2009 18:53
-
-
Save justinvt/127414 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Filters added to this controller apply to all controllers in the application. | |
# Likewise, all the methods added will be available for all controllers. | |
class ApplicationController < ActionController::Base | |
include AuthenticatedSystem | |
helper :all # include all helpers, all the time | |
#protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
# Scrub sensitive parameters from your log | |
filter_parameter_logging :password | |
layout :layout | |
def layout | |
params[:overlay] ? "overlay" : "main" | |
end | |
def admin_required | |
unless current_user.is_a?(Admin) | |
flash[:error] = t('permission_denied') | |
redirect_to root_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment