From 71eb408620826738563d7ff056013c677b07d3b6 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Tue, 2 Mar 2021 21:50:59 -0800 Subject: [PATCH] Fixup Routes: properly handle custom domains, add /events/:id alias --- config/routes.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index ef984ca9..073bfe3e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -167,6 +167,7 @@ Osem::Application.routes.draw do end end resource :program, only: [] do + get 'event/:id', to: 'proposals#show', as: :conference_program_event get 'proposal/:id', to: 'proposals#show' # For backward compatibility resources :proposals, except: :destroy do get 'commercials/render_commercial' => 'commercials#render_commercial' @@ -222,15 +223,15 @@ Osem::Application.routes.draw do get '/admin' => redirect('/admin/conferences') + constraints DomainConstraint do + root to: 'conferences#show' + end + unless ENV['OSEM_ROOT_CONFERENCE'].blank? root to: redirect("/conferences/#{ENV['OSEM_ROOT_CONFERENCE']}") else root to: 'conferences#index', via: [:get, :options] end - constraints DomainConstraint do - root to: 'conferences#show' - end - get '/.well-known/apple-developer-merchantid-domain-association', to: 'application#apple_pay' end