application_controller.rb 269 Bytes Edit Raw Blame History 1 2 3 4 5 6 7 8 9 10 11 12 class ApplicationController < ActionController::Base protect_from_forgery before_filter :authenticate_user! protected def authenticate_admin! redirect_to(root_path) and return(false) unless user_signed_in? && current_user.admin? end end