From 5cbaace3de5ca782986ddc7d65fb0c597d7432a1 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Thu, 24 Aug 2023 12:50:39 -0400 Subject: [PATCH] only unfurl for cases, not teams. --- .../concerns/authentication/current_user_manager.rb | 2 +- app/controllers/core_controller.rb | 5 +++++ config/routes.rb | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/controllers/concerns/authentication/current_user_manager.rb b/app/controllers/concerns/authentication/current_user_manager.rb index 3ee754578..7f05c7375 100644 --- a/app/controllers/concerns/authentication/current_user_manager.rb +++ b/app/controllers/concerns/authentication/current_user_manager.rb @@ -44,7 +44,7 @@ def set_current_user def require_login unless @current_user - # check if we are redirected from the case page, and if so lets support unfurling + # check if we are redirected from the case page, and if so support unfurling # by populating the flash so it renders in the start.html.erb layout. if 'core' == params[:controller] && 'index' == params[:action] && params[:id] flash[:unfurl] = Case.find_by(id: params[:id]) diff --git a/app/controllers/core_controller.rb b/app/controllers/core_controller.rb index 57f26f624..367436f85 100755 --- a/app/controllers/core_controller.rb +++ b/app/controllers/core_controller.rb @@ -8,6 +8,11 @@ class CoreController < ApplicationController def index end + # We want to distingush between a /case url and a /teams for unfurling logic. + def teams + render 'index' + end + def new @case = current_user.cases.build case_name: "Case #{current_user.cases.size}" @case.save! diff --git a/config/routes.rb b/config/routes.rb index 14820e492..773c5a32a 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -200,7 +200,7 @@ get '/cases' => 'core#index' get '/case' => 'core#index' get '/cases/import' => 'core#index' - get '/teams(/:id)' => 'core#index', as: :teams + get '/teams(/:id)' => 'core#teams', as: :teams get '/scorers' => 'core#index' # Static pages