From e209452f8b06c577ba223258a9afbf00f94d2337 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Fri, 13 Mar 2020 10:13:37 +0000 Subject: [PATCH] Make engine routes just prepend to apps routes instead of creating engine routes This makes things a bit simpler in terms of routing, we avoid a problem running specs and we can still have the engine routes separated in specific files --- config/routes.rb | 5 ----- engines/order_management/config/routes.rb | 4 ++-- engines/web/config/routes.rb | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index ae3c131ac3..dcb828b3be 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -89,11 +89,6 @@ Openfoodnetwork::Application.routes.draw do get 'sitemap.xml', to: 'sitemap#index', defaults: { format: 'xml' } - # Mount engine routes - mount Web::Engine, :at => '/' - mount Catalog::Engine, :at => '/' - mount OrderManagement::Engine, :at => '/' - # Mount Spree's routes mount Spree::Core::Engine, :at => '/' end diff --git a/engines/order_management/config/routes.rb b/engines/order_management/config/routes.rb index e221867e7e..79706c635a 100644 --- a/engines/order_management/config/routes.rb +++ b/engines/order_management/config/routes.rb @@ -1,5 +1,5 @@ -Spree::Core::Engine.routes.prepend do - namespace :admin do +Openfoodnetwork::Application.routes.prepend do + namespace :order_management do namespace :reports do resource :enterprise_fee_summary, only: [:new, :create] end diff --git a/engines/web/config/routes.rb b/engines/web/config/routes.rb index 121f3bdd9a..9126f5f621 100644 --- a/engines/web/config/routes.rb +++ b/engines/web/config/routes.rb @@ -1,4 +1,4 @@ -Web::Engine.routes.draw do +Openfoodnetwork::Application.routes.prepend do namespace :api do scope '/cookies' do resource :consent, only: [:show, :create, :destroy], controller: "cookies_consent"