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
This commit is contained in:
Luis Ramos
2020-03-13 10:13:37 +00:00
parent a8078b22f8
commit e209452f8b
3 changed files with 3 additions and 8 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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"