diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5813997..c1577c7 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -15,16 +15,19 @@ class ApplicationController < ActionController::Base private - def flash_to_http_header - return unless request.xhr? - return if flash.empty? - response.headers['X-FlashMessages'] = flash.to_hash.to_json - flash.discard # don't want the flash to appear when you reload page - end - def user_not_authorized flash[:alert] = 'Access denied.' redirect_to (request.referrer || root_path) end end + + private + + def flash_to_http_header + return unless request.xhr? + return if flash.empty? + response.headers['X-FlashMessages'] = flash.to_hash.to_json + flash.discard # don't want the flash to appear when you reload page + end + end