SwitchUser.setup do |config|
  config.available_users = { :user => lambda { User.order(:email) } }
  config.controller_guard = lambda { |current_user, request| current_user.try(:admin?) }
  config.redirect_path = lambda { |request, params| '/users/dashboard' }
  config.helper_with_guest = false
end

SwitchUser.setup do |config|
  config.available_users = { :user => lambda { User.order(:email) } }
  config.controller_guard = lambda { |current_user, request| current_user.try(:admin?) }
  config.view_guard = lambda { |current_user, request| current_user.try(:admin?) }
  config.redirect_path = lambda { |request, params| '/users/dashboard' }
  config.helper_with_guest = false
end

Make sure view helpers work in production
Make sure view helpers work in production
