mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-13 23:37:47 +00:00
Make Web engine an isolated namespace engine mounted on / (without /web prefix)
This approach is better to separate concerns, see “Isolated Engine” here: https://api.rubyonrails.org/v3.2/classes/Rails/Engine.html
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Darkswarm.controller "CookiesBannerCtrl", ($scope, CookiesBannerService, $http, $window)->
|
||||
|
||||
$scope.acceptCookies = ->
|
||||
$http.post('/web/api/cookies/consent')
|
||||
$http.post('/api/cookies/consent')
|
||||
CookiesBannerService.close()
|
||||
CookiesBannerService.disable()
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
Web::Engine.routes.draw do
|
||||
namespace :web do
|
||||
namespace :api do
|
||||
scope '/cookies' do
|
||||
resource :consent, only: [:show, :create, :destroy], controller: "cookies_consent"
|
||||
end
|
||||
namespace :api do
|
||||
scope '/cookies' do
|
||||
resource :consent, only: [:show, :create, :destroy], controller: "cookies_consent"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module Web
|
||||
class Engine < ::Rails::Engine
|
||||
isolate_namespace Web
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user