From 0bcca5be878866ef26a6ea95a6803480cc1b492e Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Sat, 7 Nov 2015 18:30:45 -0800 Subject: [PATCH] Production bug fix pundit --- app/controllers/application_controller.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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