Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

Commit ce4ed96

Browse files
committed
Merge pull request #613 from YaleSTC/613_nonadmin_flash_2
542 reverted
2 parents 06cc97b + 11797a6 commit ce4ed96

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

app/controllers/application_controller.rb

+6-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class ApplicationController < ActionController::Base
1717
c.before_filter :cart
1818
c.before_filter :fix_cart_date
1919
c.before_filter :set_view_mode
20+
c.before_filter :check_view_mode
2021
end
2122

2223
helper_method :current_user
@@ -100,11 +101,11 @@ def check_active_admin_permission
100101
end
101102

102103
def check_view_mode
103-
if current_user.role == 'admin' && current_user.view_mode != 'admin'
104-
flash[:persistent] = "Currently viewing as #{current_user.view_mode} user. You can switch back to your regular view \
105-
#{ActionController::Base.helpers.link_to('below','#view_as')} \
106-
(see #{ActionController::Base.helpers.link_to('here','https://yalestc.github.io/reservations/')} for details)."
107-
end
104+
if current_user.role == 'admin' && current_user.view_mode != 'admin'
105+
flash[:persistent] = "Currently viewing as #{current_user.view_mode} user. You can switch back to your regular view \
106+
#{ActionController::Base.helpers.link_to('below','#view_as')} \
107+
(see #{ActionController::Base.helpers.link_to('here','https://yalestc.github.io/reservations/')} for details)."
108+
end
108109
end
109110

110111
def fix_cart_date

0 commit comments

Comments
 (0)